bc8cd1d5075c1faa1edaace434ef6fcf2261d97d
[motion2.git] / server / api / smsQueue / smsQueue.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 _0xbb3e=['SmsQueue','setMaxListeners','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x3641b1,_0x1ff757){var _0x169e50=function(_0x2dc44a){while(--_0x2dc44a){_0x3641b1['push'](_0x3641b1['shift']());}};_0x169e50(++_0x1ff757);}(_0xbb3e,0x181));var _0xebb3=function(_0x2ce68c,_0x2a0626){_0x2ce68c=_0x2ce68c-0x0;var _0x480d27=_0xbb3e[_0x2ce68c];return _0x480d27;};'use strict';var EventEmitter=require(_0xebb3('0x0'));var SmsQueue=require(_0xebb3('0x1'))['db'][_0xebb3('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xebb3('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xebb3('0x4'),'afterDestroy':'remove'};function emitEvent(_0x7693ae){return function(_0x14340c,_0x187d5a,_0xa1fde5){SmsQueueEvents[_0xebb3('0x5')](_0x7693ae+':'+_0x14340c['id'],_0x14340c);SmsQueueEvents[_0xebb3('0x5')](_0x7693ae,_0x14340c);_0xa1fde5(null);};}for(var e in events){if(events[_0xebb3('0x6')](e)){var event=events[e];SmsQueue[_0xebb3('0x7')](e,emitEvent(event));}}module[_0xebb3('0x8')]=SmsQueueEvents;