Built motion from commit 639a1a7f.|2.6.19
[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 _0x1017=['exports','../../mysqldb','WhatsappAccount','setMaxListeners','save','update','remove','hasOwnProperty','hook'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x1017,0xc7));var _0x7101=function(_0x13deb5,_0x34d407){_0x13deb5=_0x13deb5-0x0;var _0x164ced=_0x1017[_0x13deb5];return _0x164ced;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0x7101('0x0'))['db'][_0x7101('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x7101('0x2')](0x0);var events={'afterCreate':_0x7101('0x3'),'afterUpdate':_0x7101('0x4'),'afterDestroy':_0x7101('0x5')};function emitEvent(_0x212227){return function(_0x5d754f,_0x5522c8,_0x155367){WhatsappAccountEvents['emit'](_0x212227+':'+_0x5d754f['id'],_0x5d754f);WhatsappAccountEvents['emit'](_0x212227,_0x5d754f);_0x155367(null);};}for(var e in events){if(events[_0x7101('0x6')](e)){var event=events[e];WhatsappAccount[_0x7101('0x7')](e,emitEvent(event));}}module[_0x7101('0x8')]=WhatsappAccountEvents;