Releases: UN-OCHA/hpc-api-core
Releases · UN-OCHA/hpc-api-core
Improvements for deletion
⚠️ BREAKING CHANGES ⚠️
- Method
createToken()
has renamed itsmodels
parameter todatabase
, in order to standardize with other similar usages
This release is focused on improving deletion of plans and entities in auth tables.
- Add new permission
DELETE_ANY_PLAN
, which is granted to HPC and RPM admins - Allow to provide a transaction to
authGrant.create
andauthGrant.update
. This method is heavily-reliant on changes happening in transaction that we now enable specifying external transaction object - Introduce auth target deletion util method
deleteAuthTarget()
and deprecate direct usage ofauthTarget.destroy()
Upgrade to Node.js v20
Add lots of utility methods
- Introduced utility methods (#128) to get:
- Years of a plan
- Basic organization info plus their type, subtype and level
- Attachment and measurement disaggregation data
- All country locations
- Some non-fetching utility methods were added (#128) to:
- Convert string to camel case
- Clean numeric values
- Introduce new permissions for update measurements (#129)
global.EDIT_ANY_MEASUREMENT
plan.EDIT_MEASUREMENTS
governingEntity.EDIT_MEASUREMENTS
Allow generatedCompositeKey everywhere generated is needed
Allow generatedCompositeKey
everywhere generated
is needed (#127)
Allow to specify flow ID when inserting new rows
-
Allow to specify flow ID when inserting new rows (#125)
DB table
flow
is the only table we have where itsid
column is part of a composite key, alongsideversionID
column. Since we weren't allowing for specifying IDs during new row insertion, it wasn't possible to create a new version of already-existing flow with the database models library
Other changes:
Require Node.js v18 and NPM v9
Expand attachment and measurement codecs
- Add
measureFields
optional field to indicator and caseload value column - Add
attachmentType
field to measurement value. It equals'indicator'
for indicator attachments and'caseLoad'
for caseload attachments - Add
name
optional field to attachment value - Allow metric total to be typed as string.
⚠️ This could break your typing checks as previously only empty string was allowed - Add
calculationMethod
field to attachment prototype and indicator value
Introduce new project editing permissions
New permissions to control who can edit project have been introduced:
project.EDIT
: Users with this permission can edit the project with that IDplan.EDIT_PROJECTS
: Users with this permission can edit projects under the plan with that IDgoverningEntity.EDIT_PROJECTS
: Users with this permission can edit the projects associated with governing entity with that IDglobal.EDIT_ANY_PROJECT
: Users with this permission can edit any project
Define highWater model
Define highWater
model (#116)