d35b914cff932ff4249f8d14242fa34a3066e785
[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 _0x84f9=['hasOwnProperty','hook','exports','events','../../mysqldb','SmsQueue','setMaxListeners','save','update','emit'];(function(_0x4f3751,_0x4d56c0){var _0x3e14a1=function(_0x2652b3){while(--_0x2652b3){_0x4f3751['push'](_0x4f3751['shift']());}};_0x3e14a1(++_0x4d56c0);}(_0x84f9,0xb7));var _0x984f=function(_0x11cfca,_0x4f3bc6){_0x11cfca=_0x11cfca-0x0;var _0x2c8cd6=_0x84f9[_0x11cfca];return _0x2c8cd6;};'use strict';var EventEmitter=require(_0x984f('0x0'));var SmsQueue=require(_0x984f('0x1'))['db'][_0x984f('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x984f('0x3')](0x0);var events={'afterCreate':_0x984f('0x4'),'afterUpdate':_0x984f('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4fcd28){return function(_0x1f9251,_0x5dd9d0,_0x4cd60b){SmsQueueEvents[_0x984f('0x6')](_0x4fcd28+':'+_0x1f9251['id'],_0x1f9251);SmsQueueEvents['emit'](_0x4fcd28,_0x1f9251);_0x4cd60b(null);};}for(var e in events){if(events[_0x984f('0x7')](e)){var event=events[e];SmsQueue[_0x984f('0x8')](e,emitEvent(event));}}module[_0x984f('0x9')]=SmsQueueEvents;