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 _0xcde7=['setMaxListeners','save','emit','hasOwnProperty','hook','WhatsappAccount'];(function(_0x5707d2,_0x539996){var _0x42a889=function(_0x54092d){while(--_0x54092d){_0x5707d2['push'](_0x5707d2['shift']());}};_0x42a889(++_0x539996);}(_0xcde7,0x65));var _0x7cde=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xcde7[_0x1cc8fe];return _0x230054;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require('../../mysqldb')['db'][_0x7cde('0x0')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x7cde('0x1')](0x0);var events={'afterCreate':_0x7cde('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x11004a){return function(_0x47962e,_0x23ec50,_0x5824bf){WhatsappAccountEvents[_0x7cde('0x3')](_0x11004a+':'+_0x47962e['id'],_0x47962e);WhatsappAccountEvents[_0x7cde('0x3')](_0x11004a,_0x47962e);_0x5824bf(null);};}for(var e in events){if(events[_0x7cde('0x4')](e)){var event=events[e];WhatsappAccount[_0x7cde('0x5')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents;