Built motion from commit 85328c08.|2.5.50
[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 _0x5d17=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','save'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x5d17,0x114));var _0x75d1=function(_0x2211b2,_0x3c32a7){_0x2211b2=_0x2211b2-0x0;var _0x1ff209=_0x5d17[_0x2211b2];return _0x1ff209;};'use strict';var EventEmitter=require(_0x75d1('0x0'));var Plugin=require(_0x75d1('0x1'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x75d1('0x2'),'afterUpdate':_0x75d1('0x3'),'afterDestroy':_0x75d1('0x4')};function emitEvent(_0x5b3267){return function(_0x177460,_0x45d03a,_0x387e35){PluginEvents[_0x75d1('0x5')](_0x5b3267+':'+_0x177460['id'],_0x177460);PluginEvents['emit'](_0x5b3267,_0x177460);_0x387e35(null);};}for(var e in events){if(events[_0x75d1('0x6')](e)){var event=events[e];Plugin[_0x75d1('0x7')](e,emitEvent(event));}}module[_0x75d1('0x8')]=PluginEvents;