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 _0xd470=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappAccount','setMaxListeners','save','update'];(function(_0x53b0f8,_0x459130){var _0x133415=function(_0x37a4a5){while(--_0x37a4a5){_0x53b0f8['push'](_0x53b0f8['shift']());}};_0x133415(++_0x459130);}(_0xd470,0x17b));var _0x0d47=function(_0x58d642,_0x5a907f){_0x58d642=_0x58d642-0x0;var _0x275130=_0xd470[_0x58d642];return _0x275130;};'use strict';var EventEmitter=require(_0x0d47('0x0'));var WhatsappAccount=require(_0x0d47('0x1'))['db'][_0x0d47('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x0d47('0x3')](0x0);var events={'afterCreate':_0x0d47('0x4'),'afterUpdate':_0x0d47('0x5'),'afterDestroy':_0x0d47('0x6')};function emitEvent(_0x19a430){return function(_0x57dd66,_0x273d87,_0x20f4e8){WhatsappAccountEvents[_0x0d47('0x7')](_0x19a430+':'+_0x57dd66['id'],_0x57dd66);WhatsappAccountEvents['emit'](_0x19a430,_0x57dd66);_0x20f4e8(null);};}for(var e in events){if(events[_0x0d47('0x8')](e)){var event=events[e];WhatsappAccount[_0x0d47('0x9')](e,emitEvent(event));}}module[_0x0d47('0xa')]=WhatsappAccountEvents;