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 _0x896e=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Plugin','setMaxListeners','save','update'];(function(_0x49ddec,_0x2e5a7a){var _0x43279e=function(_0x39ee48){while(--_0x39ee48){_0x49ddec['push'](_0x49ddec['shift']());}};_0x43279e(++_0x2e5a7a);}(_0x896e,0x1e9));var _0xe896=function(_0x31b279,_0x10323f){_0x31b279=_0x31b279-0x0;var _0x30093f=_0x896e[_0x31b279];return _0x30093f;};'use strict';var EventEmitter=require(_0xe896('0x0'));var Plugin=require(_0xe896('0x1'))['db'][_0xe896('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0xe896('0x3')](0x0);var events={'afterCreate':_0xe896('0x4'),'afterUpdate':_0xe896('0x5'),'afterDestroy':_0xe896('0x6')};function emitEvent(_0x463f56){return function(_0x3f85e5,_0x2d3521,_0x244f68){PluginEvents[_0xe896('0x7')](_0x463f56+':'+_0x3f85e5['id'],_0x3f85e5);PluginEvents['emit'](_0x463f56,_0x3f85e5);_0x244f68(null);};}for(var e in events){if(events[_0xe896('0x8')](e)){var event=events[e];Plugin[_0xe896('0x9')](e,emitEvent(event));}}module[_0xe896('0xa')]=PluginEvents;