25f3061c9fc849e2df883d525dafe386912e4c02
[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 _0xc28b=['setMaxListeners','save','update','remove','emit','exports','events','../../mysqldb','SmsQueue'];(function(_0x1ee882,_0x486ef2){var _0x375bb4=function(_0x2cc196){while(--_0x2cc196){_0x1ee882['push'](_0x1ee882['shift']());}};_0x375bb4(++_0x486ef2);}(_0xc28b,0xf9));var _0xbc28=function(_0x120fe8,_0x2168af){_0x120fe8=_0x120fe8-0x0;var _0x41f29c=_0xc28b[_0x120fe8];return _0x41f29c;};'use strict';var EventEmitter=require(_0xbc28('0x0'));var SmsQueue=require(_0xbc28('0x1'))['db'][_0xbc28('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xbc28('0x3')](0x0);var events={'afterCreate':_0xbc28('0x4'),'afterUpdate':_0xbc28('0x5'),'afterDestroy':_0xbc28('0x6')};function emitEvent(_0x4234ab){return function(_0x579769,_0x15ffb4,_0x326ca1){SmsQueueEvents['emit'](_0x4234ab+':'+_0x579769['id'],_0x579769);SmsQueueEvents[_0xbc28('0x7')](_0x4234ab,_0x579769);_0x326ca1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0xbc28('0x8')]=SmsQueueEvents;