Built motion from commit ecb45b58.|2.6.31
[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 _0x5a63=['../../mysqldb','save','emit','hasOwnProperty','exports','events'];(function(_0x14e9f0,_0x287f90){var _0xa63f7e=function(_0x4829d6){while(--_0x4829d6){_0x14e9f0['push'](_0x14e9f0['shift']());}};_0xa63f7e(++_0x287f90);}(_0x5a63,0xe3));var _0x35a6=function(_0x119944,_0x519b87){_0x119944=_0x119944-0x0;var _0x42e473=_0x5a63[_0x119944];return _0x42e473;};'use strict';var EventEmitter=require(_0x35a6('0x0'));var Plugin=require(_0x35a6('0x1'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x35a6('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x308a05){return function(_0x3462ed,_0x7a89ee,_0x4c032d){PluginEvents[_0x35a6('0x3')](_0x308a05+':'+_0x3462ed['id'],_0x3462ed);PluginEvents['emit'](_0x308a05,_0x3462ed);_0x4c032d(null);};}for(var e in events){if(events[_0x35a6('0x4')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0x35a6('0x5')]=PluginEvents;