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 _0x00f6=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','remove','emit'];(function(_0x163c5,_0x4890f0){var _0x11e2e2=function(_0x5a0d12){while(--_0x5a0d12){_0x163c5['push'](_0x163c5['shift']());}};_0x11e2e2(++_0x4890f0);}(_0x00f6,0x1d7));var _0x600f=function(_0x3bcb12,_0x380e19){_0x3bcb12=_0x3bcb12-0x0;var _0x22c753=_0x00f6[_0x3bcb12];return _0x22c753;};'use strict';var EventEmitter=require(_0x600f('0x0'));var User=require(_0x600f('0x1'))['db']['User'];var UserEvents=new EventEmitter();UserEvents[_0x600f('0x2')](0x0);var events={'afterCreate':_0x600f('0x3'),'afterUpdate':'update','afterDestroy':_0x600f('0x4')};function emitEvent(_0x47b3a5){return function(_0x215246,_0x297551,_0x455004){UserEvents[_0x600f('0x5')](_0x47b3a5+':'+_0x215246['id'],_0x215246);UserEvents[_0x600f('0x5')](_0x47b3a5,_0x215246);_0x455004(null);};}for(var e in events){if(events[_0x600f('0x6')](e)){var event=events[e];User[_0x600f('0x7')](e,emitEvent(event));}}module[_0x600f('0x8')]=UserEvents;