Built motion from commit (unavailable).|2.5.11
[motion2.git] / server / api / whatsappQueue / whatsappQueue.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 _0x4f66=['setMaxListeners','save','update','remove','emit','hook','events','../../mysqldb','WhatsappQueue'];(function(_0x2755fb,_0x5970f1){var _0x293f12=function(_0x4c629d){while(--_0x4c629d){_0x2755fb['push'](_0x2755fb['shift']());}};_0x293f12(++_0x5970f1);}(_0x4f66,0x138));var _0x64f6=function(_0x2f2aa9,_0x35c7a2){_0x2f2aa9=_0x2f2aa9-0x0;var _0x510c2a=_0x4f66[_0x2f2aa9];return _0x510c2a;};'use strict';var EventEmitter=require(_0x64f6('0x0'));var WhatsappQueue=require(_0x64f6('0x1'))['db'][_0x64f6('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x64f6('0x3')](0x0);var events={'afterCreate':_0x64f6('0x4'),'afterUpdate':_0x64f6('0x5'),'afterDestroy':_0x64f6('0x6')};function emitEvent(_0x444336){return function(_0x291614,_0x6e6901,_0x4bfe2e){WhatsappQueueEvents['emit'](_0x444336+':'+_0x291614['id'],_0x291614);WhatsappQueueEvents[_0x64f6('0x7')](_0x444336,_0x291614);_0x4bfe2e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0x64f6('0x8')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents;