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 _0xbec1=['events','../../mysqldb','WhatsappAccount','setMaxListeners','save','update','hook','exports'];(function(_0x5c473d,_0x312ec3){var _0x16026c=function(_0x1afc93){while(--_0x1afc93){_0x5c473d['push'](_0x5c473d['shift']());}};_0x16026c(++_0x312ec3);}(_0xbec1,0x190));var _0x1bec=function(_0x3630d3,_0x17503c){_0x3630d3=_0x3630d3-0x0;var _0x40c088=_0xbec1[_0x3630d3];return _0x40c088;};'use strict';var EventEmitter=require(_0x1bec('0x0'));var WhatsappAccount=require(_0x1bec('0x1'))['db'][_0x1bec('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x1bec('0x3')](0x0);var events={'afterCreate':_0x1bec('0x4'),'afterUpdate':_0x1bec('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2c1e23){return function(_0x58b411,_0x5ec79e,_0x5563d6){WhatsappAccountEvents['emit'](_0x2c1e23+':'+_0x58b411['id'],_0x58b411);WhatsappAccountEvents['emit'](_0x2c1e23,_0x58b411);_0x5563d6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0x1bec('0x6')](e,emitEvent(event));}}module[_0x1bec('0x7')]=WhatsappAccountEvents;