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 _0x11e5=['emit','hasOwnProperty','hook','events','WhatsappAccount','setMaxListeners','update','remove'];(function(_0x202523,_0x31d05d){var _0x47841c=function(_0x5ad2d6){while(--_0x5ad2d6){_0x202523['push'](_0x202523['shift']());}};_0x47841c(++_0x31d05d);}(_0x11e5,0x8b));var _0x511e=function(_0xfb0801,_0x1ae851){_0xfb0801=_0xfb0801-0x0;var _0x1699c3=_0x11e5[_0xfb0801];return _0x1699c3;};'use strict';var EventEmitter=require(_0x511e('0x0'));var WhatsappAccount=require('../../mysqldb')['db'][_0x511e('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x511e('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x511e('0x3'),'afterDestroy':_0x511e('0x4')};function emitEvent(_0x101e06){return function(_0x5cab33,_0x249e4d,_0x4fbd4f){WhatsappAccountEvents['emit'](_0x101e06+':'+_0x5cab33['id'],_0x5cab33);WhatsappAccountEvents[_0x511e('0x5')](_0x101e06,_0x5cab33);_0x4fbd4f(null);};}for(var e in events){if(events[_0x511e('0x6')](e)){var event=events[e];WhatsappAccount[_0x511e('0x7')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents;