f1cc4cf968ed295ee60732276b83f2eb20ada8ee
[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 _0xe82b=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x27669b,_0x306a2c){var _0x31ed6e=function(_0x1a6b6c){while(--_0x1a6b6c){_0x27669b['push'](_0x27669b['shift']());}};_0x31ed6e(++_0x306a2c);}(_0xe82b,0x11a));var _0xbe82=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xe82b[_0x47b58b];return _0x46bebe;};'use strict';var EventEmitter=require(_0xbe82('0x0'));var SmsQueue=require(_0xbe82('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xbe82('0x2')](0x0);var events={'afterCreate':_0xbe82('0x3'),'afterUpdate':_0xbe82('0x4'),'afterDestroy':_0xbe82('0x5')};function emitEvent(_0xcf0042){return function(_0x3230dc,_0x4c28ba,_0x4494b7){SmsQueueEvents[_0xbe82('0x6')](_0xcf0042+':'+_0x3230dc['id'],_0x3230dc);SmsQueueEvents['emit'](_0xcf0042,_0x3230dc);_0x4494b7(null);};}for(var e in events){if(events[_0xbe82('0x7')](e)){var event=events[e];SmsQueue[_0xbe82('0x8')](e,emitEvent(event));}}module[_0xbe82('0x9')]=SmsQueueEvents;