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 _0xe2bc=['save','update','remove','emit','hasOwnProperty','hook','events','WhatsappAccount'];(function(_0x4ec9d7,_0x9b4268){var _0x41067e=function(_0x286ee8){while(--_0x286ee8){_0x4ec9d7['push'](_0x4ec9d7['shift']());}};_0x41067e(++_0x9b4268);}(_0xe2bc,0x1a6));var _0xce2b=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0xe2bc[_0x2112d4];return _0x434972;};'use strict';var EventEmitter=require(_0xce2b('0x0'));var WhatsappAccount=require('../../mysqldb')['db'][_0xce2b('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xce2b('0x2'),'afterUpdate':_0xce2b('0x3'),'afterDestroy':_0xce2b('0x4')};function emitEvent(_0x231ea2){return function(_0x3f7887,_0x5af322,_0x29382b){WhatsappAccountEvents[_0xce2b('0x5')](_0x231ea2+':'+_0x3f7887['id'],_0x3f7887);WhatsappAccountEvents[_0xce2b('0x5')](_0x231ea2,_0x3f7887);_0x29382b(null);};}for(var e in events){if(events[_0xce2b('0x6')](e)){var event=events[e];WhatsappAccount[_0xce2b('0x7')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents;