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 _0xb145=['exports','../../mysqldb','Plugin','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x2c3f07,_0xe7f862){var _0x2e17e8=function(_0x25aa4d){while(--_0x25aa4d){_0x2c3f07['push'](_0x2c3f07['shift']());}};_0x2e17e8(++_0xe7f862);}(_0xb145,0xa3));var _0x5b14=function(_0x2aea53,_0x1d1257){_0x2aea53=_0x2aea53-0x0;var _0x2e9b7c=_0xb145[_0x2aea53];return _0x2e9b7c;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x5b14('0x0'))['db'][_0x5b14('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x5b14('0x2')](0x0);var events={'afterCreate':_0x5b14('0x3'),'afterUpdate':_0x5b14('0x4'),'afterDestroy':_0x5b14('0x5')};function emitEvent(_0x31f6f0){return function(_0x34b4cd,_0x5111cd,_0x1e0b5b){PluginEvents[_0x5b14('0x6')](_0x31f6f0+':'+_0x34b4cd['id'],_0x34b4cd);PluginEvents[_0x5b14('0x6')](_0x31f6f0,_0x34b4cd);_0x1e0b5b(null);};}for(var e in events){if(events[_0x5b14('0x7')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0x5b14('0x8')]=PluginEvents;