856566934a86abb81f779911202d769fbaab5846
[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 _0x4d04=['hook','events','SmsQueue','setMaxListeners','save','emit'];(function(_0x156ab2,_0x70a54e){var _0xc8631e=function(_0x1d91f4){while(--_0x1d91f4){_0x156ab2['push'](_0x156ab2['shift']());}};_0xc8631e(++_0x70a54e);}(_0x4d04,0x8b));var _0x44d0=function(_0x3166fc,_0x2199af){_0x3166fc=_0x3166fc-0x0;var _0x32315f=_0x4d04[_0x3166fc];return _0x32315f;};'use strict';var EventEmitter=require(_0x44d0('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0x44d0('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x44d0('0x2')](0x0);var events={'afterCreate':_0x44d0('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x57e9ff){return function(_0x295fc0,_0x11cdc4,_0x52f2cc){SmsQueueEvents[_0x44d0('0x4')](_0x57e9ff+':'+_0x295fc0['id'],_0x295fc0);SmsQueueEvents[_0x44d0('0x4')](_0x57e9ff,_0x295fc0);_0x52f2cc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0x44d0('0x5')](e,emitEvent(event));}}module['exports']=SmsQueueEvents;