d9a7e9b4dac5e233f9cfccdaf474e51a00856a80
[motion2.git] / server / api / chatQueue / chatQueue.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 _0x0d1a=['events','../../mysqldb','ChatQueue','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x9cf723,_0x4fd2d4){var _0x58ed46=function(_0xb2ff39){while(--_0xb2ff39){_0x9cf723['push'](_0x9cf723['shift']());}};_0x58ed46(++_0x4fd2d4);}(_0x0d1a,0x1e6));var _0xa0d1=function(_0x1ea259,_0x4a177){_0x1ea259=_0x1ea259-0x0;var _0x5d13d1=_0x0d1a[_0x1ea259];return _0x5d13d1;};'use strict';var EventEmitter=require(_0xa0d1('0x0'));var ChatQueue=require(_0xa0d1('0x1'))['db'][_0xa0d1('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa0d1('0x3'),'afterUpdate':'update','afterDestroy':_0xa0d1('0x4')};function emitEvent(_0x153ab5){return function(_0xaa0c3e,_0x1c0966,_0x466865){ChatQueueEvents['emit'](_0x153ab5+':'+_0xaa0c3e['id'],_0xaa0c3e);ChatQueueEvents[_0xa0d1('0x5')](_0x153ab5,_0xaa0c3e);_0x466865(null);};}for(var e in events){if(events[_0xa0d1('0x6')](e)){var event=events[e];ChatQueue[_0xa0d1('0x7')](e,emitEvent(event));}}module[_0xa0d1('0x8')]=ChatQueueEvents;