Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: UN-OCHA/hpc-api-core
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 5ae055f6c52a4dc520eed9b725dedad251659bff
Choose a base ref
..
head repository: UN-OCHA/hpc-api-core
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 324f46bd2f17c6947b37fe2509308601638bdac4
Choose a head ref
Showing with 188 additions and 219 deletions.
  1. +7 −7 package.json
  2. +5 −24 src/db/models/entityPrototype.ts
  3. +176 −188 yarn.lock
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@unocha/hpc-api-core",
"version": "10.7.0",
"version": "10.7.1",
"description": "Core libraries supporting HPC.Tools API Backend",
"license": "Apache-2.0",
"private": false,
@@ -29,16 +29,16 @@
},
"devDependencies": {
"@types/jest": "^29.5.14",
"@types/node": "^22.10.1",
"@types/node": "^22.10.3",
"@types/pg": "^8.11.10",
"@unocha/hpc-repo-tools": "^5.2.0",
"eslint": "^9.14.0",
"@unocha/hpc-repo-tools": "^5.5.0",
"eslint": "^9.16.0",
"husky": "^9.1.7",
"jest": "^29.7.0",
"lint-staged": "^15.2.10",
"prettier": "3.4.1",
"lint-staged": "^15.3.0",
"prettier": "3.4.2",
"ts-jest": "^29.2.5",
"typescript": "^5.6.3"
"typescript": "^5.7.2"
},
"lint-staged": {
"*.{ts,js}": [
29 changes: 5 additions & 24 deletions src/db/models/entityPrototype.ts
Original file line number Diff line number Diff line change
@@ -40,30 +40,11 @@ export const ENTITY_PROTOTYPE_TYPE = t.keyof({
});

const ENTITY_REFS = t.array(
t.intersection([
t.type({
/**
* Like in many other areas where IDs are stored in JSON in DB,
* there is a mixup of values with strings
*
* TODO: Make sure no more string values are stored instead of numerical IDs
*/
id: t.union([ENTITY_PROTOTYPE_ID, t.string]),
refCode: t.string,
}),
t.partial({
cardinality: t.union([t.literal('1-1'), t.literal('0-N')]),
/**
* @deprecated
* There are records in database that have
* this typo "cadinality", instead of "cardinality"
*
* TODO: Rename this property to "cardinality" in DB, then,
* drop this definition and make "cardinality" required
*/
cadinality: t.union([t.literal('1-1'), t.literal('0-N')]),
}),
])
t.type({
id: ENTITY_PROTOTYPE_ID,
refCode: t.string,
cardinality: t.union([t.literal('1-1'), t.literal('0-N')]),
})
);

export const ENTITY_PROTOTYPE_VALUE = t.intersection([
Loading