Built motion from commit (unavailable).|2.5.11
[motion2.git] / server / api / plugin / plugin.events.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0xd943=['../../mysqldb','Plugin','setMaxListeners','update','remove','emit','events'];(function(_0x4f22a2,_0x25d366){var _0x4fcb2b=function(_0x5bf931){while(--_0x5bf931){_0x4f22a2['push'](_0x4f22a2['shift']());}};_0x4fcb2b(++_0x25d366);}(_0xd943,0x15d));var _0x3d94=function(_0xe4e841,_0x5e4273){_0xe4e841=_0xe4e841-0x0;var _0x34972e=_0xd943[_0xe4e841];return _0x34972e;};'use strict';var EventEmitter=require(_0x3d94('0x0'));var Plugin=require(_0x3d94('0x1'))['db'][_0x3d94('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x3d94('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3d94('0x4'),'afterDestroy':_0x3d94('0x5')};function emitEvent(_0x38b5ca){return function(_0xc13b61,_0xaf8962,_0x5751f6){PluginEvents['emit'](_0x38b5ca+':'+_0xc13b61['id'],_0xc13b61);PluginEvents[_0x3d94('0x6')](_0x38b5ca,_0xc13b61);_0x5751f6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module['exports']=PluginEvents;