seneca-entity-util
Utilities for Seneca entities.
- rtag: random revision tags generated per save; provides support for complex object caching.
- archive: archival of deleted entities.
- when: injection of created and modified time stamps
- duration: injection of entity action duration times in results as meta data
Install
$ npm install seneca-entity-util seneca-promisify
Options
rtag.active
: boolean falsertag.field
: string "rtag"rtag.len
: number 17rtag.annotate
: boolean truertag.stats
: boolean truertag.clone_before_hydrate
: boolean truewhen.active
: boolean falsewhen.field_created
: string "t_c"when.field_modified
: string "t_m"duration.active
: boolean falseduration.annotation
: string "d$"duration.stats
: boolean truearchive.active
: boolean falsearchive.entity
: string "sys/archive"archive.custom_props
: arrayderive.active
: boolean false
Set plugin options when loading with:
seneca
Note: foo.bar
in the list above means
{ foo: { bar: ... } }
Action Patterns
- role:cache,resolve:rtag
- role:cache,stats:rtag
- role:entity,cmd:list
- role:entity,cmd:load
- role:entity,cmd:remove
- role:entity,cmd:save
- sys:entity,derive:add
- sys:entity,derive:list
Action Descriptions
role:cache,resolve:rtag
»
« Use rtag to load cached version of expensive result.
Parameters
- space : string " "
- key : string " "
- rtag : string " "
- resolver : function " "
role:cache,stats:rtag
»
« Get rtag cache usage statistics.
role:entity,cmd:list
»
« No description provided.
role:entity,cmd:load
»
« No description provided.
role:entity,cmd:remove
»
« No description provided.
role:entity,cmd:save
»
« Override role:entity,cmd:save to apply utilities.
sys:entity,derive:add
»
« No description provided.
sys:entity,derive:list
»
« No description provided.