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 _0xdbf5=['hook','exports','events','../../mysqldb','WhatsappAccount','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0xdbf5,0x8e));var _0x5dbf=function(_0x50f888,_0x559bec){_0x50f888=_0x50f888-0x0;var _0x52fa21=_0xdbf5[_0x50f888];return _0x52fa21;};'use strict';var EventEmitter=require(_0x5dbf('0x0'));var WhatsappAccount=require(_0x5dbf('0x1'))['db'][_0x5dbf('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x5dbf('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5dbf('0x4'),'afterDestroy':_0x5dbf('0x5')};function emitEvent(_0x98be7e){return function(_0x593c36,_0x1b3452,_0x510ac8){WhatsappAccountEvents[_0x5dbf('0x6')](_0x98be7e+':'+_0x593c36['id'],_0x593c36);WhatsappAccountEvents['emit'](_0x98be7e,_0x593c36);_0x510ac8(null);};}for(var e in events){if(events[_0x5dbf('0x7')](e)){var event=events[e];WhatsappAccount[_0x5dbf('0x8')](e,emitEvent(event));}}module[_0x5dbf('0x9')]=WhatsappAccountEvents;