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 _0x8936=['update','remove','emit','hasOwnProperty','WhatsappAccount','setMaxListeners','save'];(function(_0x2f5aa4,_0x34ee30){var _0x1e8a41=function(_0x4e6ae7){while(--_0x4e6ae7){_0x2f5aa4['push'](_0x2f5aa4['shift']());}};_0x1e8a41(++_0x34ee30);}(_0x8936,0x17e));var _0x6893=function(_0x319b0e,_0x3de987){_0x319b0e=_0x319b0e-0x0;var _0x30d3ec=_0x8936[_0x319b0e];return _0x30d3ec;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require('../../mysqldb')['db'][_0x6893('0x0')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x6893('0x1')](0x0);var events={'afterCreate':_0x6893('0x2'),'afterUpdate':_0x6893('0x3'),'afterDestroy':_0x6893('0x4')};function emitEvent(_0x19fc00){return function(_0x256de5,_0x16b26e,_0xa91472){WhatsappAccountEvents['emit'](_0x19fc00+':'+_0x256de5['id'],_0x256de5);WhatsappAccountEvents[_0x6893('0x5')](_0x19fc00,_0x256de5);_0xa91472(null);};}for(var e in events){if(events[_0x6893('0x6')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents;