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 _0xea69=['WhatsappAccount','setMaxListeners','save','update','emit','hook','../../mysqldb'];(function(_0x555b2f,_0x43b622){var _0x81c0a6=function(_0x4629e6){while(--_0x4629e6){_0x555b2f['push'](_0x555b2f['shift']());}};_0x81c0a6(++_0x43b622);}(_0xea69,0x8b));var _0x9ea6=function(_0x397706,_0x32a840){_0x397706=_0x397706-0x0;var _0x4ffa44=_0xea69[_0x397706];return _0x4ffa44;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0x9ea6('0x0'))['db'][_0x9ea6('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x9ea6('0x2')](0x0);var events={'afterCreate':_0x9ea6('0x3'),'afterUpdate':_0x9ea6('0x4'),'afterDestroy':'remove'};function emitEvent(_0x51ebfa){return function(_0x38df7f,_0x12c2d1,_0x1c05b9){WhatsappAccountEvents[_0x9ea6('0x5')](_0x51ebfa+':'+_0x38df7f['id'],_0x38df7f);WhatsappAccountEvents['emit'](_0x51ebfa,_0x38df7f);_0x1c05b9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0x9ea6('0x6')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents;