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 _0x0c94=['events','../../mysqldb','WhatsappAccount','setMaxListeners','save','remove','emit','hook','exports'];(function(_0x26d741,_0x18409b){var _0x564540=function(_0x23250b){while(--_0x23250b){_0x26d741['push'](_0x26d741['shift']());}};_0x564540(++_0x18409b);}(_0x0c94,0x1a7));var _0x40c9=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x0c94[_0x5d4607];return _0x5e4a86;};'use strict';var EventEmitter=require(_0x40c9('0x0'));var WhatsappAccount=require(_0x40c9('0x1'))['db'][_0x40c9('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x40c9('0x3')](0x0);var events={'afterCreate':_0x40c9('0x4'),'afterUpdate':'update','afterDestroy':_0x40c9('0x5')};function emitEvent(_0x1d30dd){return function(_0x2a7d84,_0x4ffacc,_0x50cad8){WhatsappAccountEvents[_0x40c9('0x6')](_0x1d30dd+':'+_0x2a7d84['id'],_0x2a7d84);WhatsappAccountEvents['emit'](_0x1d30dd,_0x2a7d84);_0x50cad8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0x40c9('0x7')](e,emitEvent(event));}}module[_0x40c9('0x8')]=WhatsappAccountEvents;