netiam-adapter-sequelize
A sequelize persistence adapter
Get it
npm i -S netiam netiam-adapter-sequelize
Anatomy of a persistence adapter
Every adapter has to export a public interface with the following requirements.
/** * Get ID names for type * @param * @returns */ {} /** * Get type by model * @param * @returns */ {} /** * Get model by type * @param * @returns */ {} /** * Find one or more resources * @param * @param {string|number|string[]|number[]} [id] - A single or list of resource IDs to find * @param * @param * @param * @param * @param * @param * @param * @param * @param * @param * @param * @returns */ {} /** * Update a resource * @param * @param * @param * @returns */ {} /** * Delete a resource * @param * @param * @returns */ {} /** * Set attributes for a resource * @param * @param * @param * @returns */ {} /** * Get only the attributes for a specific resource * @param * @param * @returns */ {} /** * Get all attribute keys as list of path names * @param * @param * @returns */ {} /** * Set a relationship for a resource * @param * @param * @param * @param * @see * @returns */ {} /** * Set relationships for a resource * @param * @param * @param {object.<string, object>|object.<string, object[]>} relationships - The relationships to set * @returns */ {} /** * Get a relationship from resource * @param * @param * @param * @returns */ {} /** * Get all relationships as list of path names * @param * @param * @returns */ {} /** * Check if a specific type has a relationship defined * @param * @param * @returns */ {} /** * Get the type of a relationship * @param * @param * @returns */ {}