c133e8dbbc8e3b4e582c2595cae9acb428da2724
[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 _0xea49=['emit','hook','exports','events','../../mysqldb','SmsQueue','setMaxListeners','save','update'];(function(_0x58482a,_0x5a97bf){var _0x523713=function(_0x13c4c1){while(--_0x13c4c1){_0x58482a['push'](_0x58482a['shift']());}};_0x523713(++_0x5a97bf);}(_0xea49,0x111));var _0x9ea4=function(_0x3b0e97,_0x52a018){_0x3b0e97=_0x3b0e97-0x0;var _0x200b84=_0xea49[_0x3b0e97];return _0x200b84;};'use strict';var EventEmitter=require(_0x9ea4('0x0'));var SmsQueue=require(_0x9ea4('0x1'))['db'][_0x9ea4('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x9ea4('0x3')](0x0);var events={'afterCreate':_0x9ea4('0x4'),'afterUpdate':_0x9ea4('0x5'),'afterDestroy':'remove'};function emitEvent(_0x47250a){return function(_0x463218,_0x37896b,_0x11eba8){SmsQueueEvents[_0x9ea4('0x6')](_0x47250a+':'+_0x463218['id'],_0x463218);SmsQueueEvents[_0x9ea4('0x6')](_0x47250a,_0x463218);_0x11eba8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0x9ea4('0x7')](e,emitEvent(event));}}module[_0x9ea4('0x8')]=SmsQueueEvents;