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 _0x737d=['../../mysqldb','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x22a209,_0x59f39a){var _0x17cc00=function(_0x1f3e8f){while(--_0x1f3e8f){_0x22a209['push'](_0x22a209['shift']());}};_0x17cc00(++_0x59f39a);}(_0x737d,0xbc));var _0xd737=function(_0x371880,_0x5532d3){_0x371880=_0x371880-0x0;var _0x43a378=_0x737d[_0x371880];return _0x43a378;};'use strict';var EventEmitter=require(_0xd737('0x0'));var Plugin=require(_0xd737('0x1'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xd737('0x2')};function emitEvent(_0x5ce3d6){return function(_0x2f8396,_0x4a19e0,_0x44478b){PluginEvents[_0xd737('0x3')](_0x5ce3d6+':'+_0x2f8396['id'],_0x2f8396);PluginEvents[_0xd737('0x3')](_0x5ce3d6,_0x2f8396);_0x44478b(null);};}for(var e in events){if(events[_0xd737('0x4')](e)){var event=events[e];Plugin[_0xd737('0x5')](e,emitEvent(event));}}module[_0xd737('0x6')]=PluginEvents;