@dadi/api
Advanced tools
Changelog
runHooks
parameter to model methodsfields
object when creating and updating documentsquery.useVersionFilter
config property@dadi/api-filestore
$
The structure of collection endpoint URLs has changed from /:version/:database/:name
to /:property/:name
. In practice, this means that consumers must update the URLs being used to reach API collections by removing the first node (version).
The database
property was renamed to property
, as it more accurately describes the fact that multiple applications can run on a single API instance, which does not necessarily mean the same separation in terms of databases.
Consumers using API wrapper must upgrade their package to version 4.
The signature of the Model
export has changed. Rather than accepting the name of the collection as a String, it now expects an object with property
and name
keys, indicating the name of the property (previously called database) and the name of the collection, respectively.
const {Model} = require('@dadi/api')
// Version 5 and prior
Model('books').find({})
// Version 6
Model({property: 'library', name: 'books'}).find({})
It is now mandatory to supply a key for signing tokens via the auth.tokenKey
configuration properly. It can be a string of any length, as long as it's kept secret.
Failing to provide this configuration property will make API throw a fatal error on startup.
Changelog
The way API clients are internally stored has changed. After upgrading to 5.0.0, existing clients must be migrated. See https://docs.dadi.cloud/api/5.0#migrating-from-version-4-to-5 for more information.