ec8b369c4b4debb9896e539adcefdd2dcd03bc27
[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 _0x31f0=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners'];(function(_0x1f1402,_0x36059f){var _0x11426b=function(_0x4b27a8){while(--_0x4b27a8){_0x1f1402['push'](_0x1f1402['shift']());}};_0x11426b(++_0x36059f);}(_0x31f0,0x14d));var _0x031f=function(_0x301272,_0x326b3f){_0x301272=_0x301272-0x0;var _0x18d042=_0x31f0[_0x301272];return _0x18d042;};'use strict';var EventEmitter=require(_0x031f('0x0'));var SmsQueue=require(_0x031f('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x031f('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x031f('0x3'),'afterDestroy':_0x031f('0x4')};function emitEvent(_0x2a77dc){return function(_0x157df5,_0x4f2f23,_0x14a14e){SmsQueueEvents['emit'](_0x2a77dc+':'+_0x157df5['id'],_0x157df5);SmsQueueEvents[_0x031f('0x5')](_0x2a77dc,_0x157df5);_0x14a14e(null);};}for(var e in events){if(events[_0x031f('0x6')](e)){var event=events[e];SmsQueue[_0x031f('0x7')](e,emitEvent(event));}}module['exports']=SmsQueueEvents;