e3f0083e91beeb39a73d00410e5525a9ea1d5ff2
[motion2.git] / server / api / openchannelQueue / openchannelQueue.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 _0xec3b=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','update'];(function(_0x5687d3,_0x980d0b){var _0x31988b=function(_0x193486){while(--_0x193486){_0x5687d3['push'](_0x5687d3['shift']());}};_0x31988b(++_0x980d0b);}(_0xec3b,0x194));var _0xbec3=function(_0x5c38b3,_0x423ea3){_0x5c38b3=_0x5c38b3-0x0;var _0x611cc6=_0xec3b[_0x5c38b3];return _0x611cc6;};'use strict';var EventEmitter=require(_0xbec3('0x0'));var OpenchannelQueue=require(_0xbec3('0x1'))['db'][_0xbec3('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xbec3('0x3')](0x0);var events={'afterCreate':_0xbec3('0x4'),'afterUpdate':_0xbec3('0x5'),'afterDestroy':_0xbec3('0x6')};function emitEvent(_0x5a2f76){return function(_0x36e533,_0x3a06ab,_0x4e5c93){OpenchannelQueueEvents[_0xbec3('0x7')](_0x5a2f76+':'+_0x36e533['id'],_0x36e533);OpenchannelQueueEvents['emit'](_0x5a2f76,_0x36e533);_0x4e5c93(null);};}for(var e in events){if(events[_0xbec3('0x8')](e)){var event=events[e];OpenchannelQueue[_0xbec3('0x9')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents;