For now, we can add listeners to kuzzle events like that
either using the whole event name
examples for document controller events:
document:beforeGet, document:afterGet, document:beforeCreate, document:afterCreate, etc.
or with a full wildcard for the 2nd part of the event (after the : sign)
example: document:*, which will be called each time any event is triggered by document controller.
It could be useful to also configure pipe with prefixes wildcards (document:before* or document:after*), to trigger every actions of document controller, either before, or after the request.
We could, for example, change this method to use an additional optional parameter prefix (which can be either before or after), and return an array of wilcarded events (['document:*', 'document:before*'] if we call getWilcarderEvents('document:beforeGet', 'before')
For now, we can add listeners to kuzzle events like that
document:beforeGet
,document:afterGet
,document:beforeCreate
,document:afterCreate
, etc.:
sign) example:document:*
, which will be called each time any event is triggered bydocument
controller.It could be useful to also configure pipe with prefixes wildcards (
document:before*
ordocument:after*
), to trigger every actions ofdocument
controller, either before, or after the request.Possible Solution
trigger
method use [getWildardEvent(event)](https://github.com/kuzzleio/kuzzle/blob/master/lib/api/core/plugins/pluginsManager.js#L831] to get the related wildcarded event and trigger, for example, bothdocument:beforeGet
anddocument:*
events.We could, for example, change this method to use an additional optional parameter
prefix
(which can be eitherbefore
orafter
), and return an array of wilcarded events (['document:*', 'document:before*']
if we callgetWilcarderEvents('document:beforeGet', 'before')