Built motion from commit 1fa89557.|2.6.10
[motion2.git] / server / api / whatsappAccount / whatsappAccount.events.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
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.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x7c08=['hook','exports','events','../../mysqldb','WhatsappAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x414d43,_0x5fb059){var _0x36e4cb=function(_0x17860d){while(--_0x17860d){_0x414d43['push'](_0x414d43['shift']());}};_0x36e4cb(++_0x5fb059);}(_0x7c08,0x178));var _0x87c0=function(_0x270d48,_0x2e1ee1){_0x270d48=_0x270d48-0x0;var _0x2cc618=_0x7c08[_0x270d48];return _0x2cc618;};'use strict';var EventEmitter=require(_0x87c0('0x0'));var WhatsappAccount=require(_0x87c0('0x1'))['db'][_0x87c0('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x87c0('0x3')](0x0);var events={'afterCreate':_0x87c0('0x4'),'afterUpdate':_0x87c0('0x5'),'afterDestroy':_0x87c0('0x6')};function emitEvent(_0x3e61fd){return function(_0x2de5ec,_0x48524e,_0x2b71ce){WhatsappAccountEvents['emit'](_0x3e61fd+':'+_0x2de5ec['id'],_0x2de5ec);WhatsappAccountEvents[_0x87c0('0x7')](_0x3e61fd,_0x2de5ec);_0x2b71ce(null);};}for(var e in events){if(events[_0x87c0('0x8')](e)){var event=events[e];WhatsappAccount[_0x87c0('0x9')](e,emitEvent(event));}}module[_0x87c0('0xa')]=WhatsappAccountEvents;