1 // *************************************************************************
3 // * xCALLY Motion - The Omnichannel Contact Center *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved *
6 // *************************************************************************
8 // * Email: info@xcally.com *
9 // * Website: https://www.xcally.com *
11 // *************************************************************************
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. *
17 // *************************************************************************
18 var _0xd117=['exports','events','../../mysqldb','Plugin','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x10784b,_0x59bd34){var _0x3123b4=function(_0x2a58a5){while(--_0x2a58a5){_0x10784b['push'](_0x10784b['shift']());}};_0x3123b4(++_0x59bd34);}(_0xd117,0x182));var _0x7d11=function(_0x2384f6,_0x167775){_0x2384f6=_0x2384f6-0x0;var _0x370294=_0xd117[_0x2384f6];return _0x370294;};'use strict';var EventEmitter=require(_0x7d11('0x0'));var Plugin=require(_0x7d11('0x1'))['db'][_0x7d11('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x7d11('0x3')](0x0);var events={'afterCreate':_0x7d11('0x4'),'afterUpdate':_0x7d11('0x5'),'afterDestroy':_0x7d11('0x6')};function emitEvent(_0x254bb4){return function(_0x3c07be,_0x31fcb0,_0x589c51){PluginEvents[_0x7d11('0x7')](_0x254bb4+':'+_0x3c07be['id'],_0x3c07be);PluginEvents[_0x7d11('0x7')](_0x254bb4,_0x3c07be);_0x589c51(null);};}for(var e in events){if(events[_0x7d11('0x8')](e)){var event=events[e];Plugin[_0x7d11('0x9')](e,emitEvent(event));}}module[_0x7d11('0xa')]=PluginEvents;