682f0f11bc5ed834374a0e160ec2fd757783bf89
[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 _0x1928=['setMaxListeners','save','update','remove','emit','hook','exports','events','../../mysqldb','ChatQueue'];(function(_0x2ed22c,_0x5ba2b1){var _0x10d89a=function(_0x435ddd){while(--_0x435ddd){_0x2ed22c['push'](_0x2ed22c['shift']());}};_0x10d89a(++_0x5ba2b1);}(_0x1928,0x183));var _0x8192=function(_0x2d7720,_0x3b176f){_0x2d7720=_0x2d7720-0x0;var _0x1345dc=_0x1928[_0x2d7720];return _0x1345dc;};'use strict';var EventEmitter=require(_0x8192('0x0'));var ChatQueue=require(_0x8192('0x1'))['db'][_0x8192('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x8192('0x3')](0x0);var events={'afterCreate':_0x8192('0x4'),'afterUpdate':_0x8192('0x5'),'afterDestroy':_0x8192('0x6')};function emitEvent(_0x2c1c17){return function(_0xcafdfd,_0xfa58df,_0x1e4e0d){ChatQueueEvents[_0x8192('0x7')](_0x2c1c17+':'+_0xcafdfd['id'],_0xcafdfd);ChatQueueEvents['emit'](_0x2c1c17,_0xcafdfd);_0x1e4e0d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x8192('0x8')](e,emitEvent(event));}}module[_0x8192('0x9')]=ChatQueueEvents;