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 _0xec17=['events','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x6dd5c,_0x4bfc19){var _0x5a87fa=function(_0x3b068b){while(--_0x3b068b){_0x6dd5c['push'](_0x6dd5c['shift']());}};_0x5a87fa(++_0x4bfc19);}(_0xec17,0x132));var _0x7ec1=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xec17[_0x59ee6f];return _0x4c0979;};'use strict';var EventEmitter=require(_0x7ec1('0x0'));var CmContact=require(_0x7ec1('0x1'))['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents[_0x7ec1('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7ec1('0x3'),'afterDestroy':_0x7ec1('0x4')};function emitEvent(_0x1292e9){return function(_0x24855f,_0x1531fd,_0xd56e76){CmContactEvents[_0x7ec1('0x5')](_0x1292e9+':'+_0x24855f['id'],_0x24855f);CmContactEvents['emit'](_0x1292e9,_0x24855f);_0xd56e76(null);};}for(var e in events){if(events[_0x7ec1('0x6')](e)){var event=events[e];CmContact[_0x7ec1('0x7')](e,emitEvent(event));}}module[_0x7ec1('0x8')]=CmContactEvents;