06ea8775f257a2c787816bbd6072b21eaf1e1d66
[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 _0x3a58=['OpenchannelQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x55fe55,_0x4e08e3){var _0x56476a=function(_0x41283c){while(--_0x41283c){_0x55fe55['push'](_0x55fe55['shift']());}};_0x56476a(++_0x4e08e3);}(_0x3a58,0xda));var _0x83a5=function(_0xbe2cdf,_0x426d41){_0xbe2cdf=_0xbe2cdf-0x0;var _0x36e476=_0x3a58[_0xbe2cdf];return _0x36e476;};'use strict';var EventEmitter=require(_0x83a5('0x0'));var OpenchannelQueue=require(_0x83a5('0x1'))['db'][_0x83a5('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x83a5('0x3')](0x0);var events={'afterCreate':_0x83a5('0x4'),'afterUpdate':_0x83a5('0x5'),'afterDestroy':_0x83a5('0x6')};function emitEvent(_0x5b58b7){return function(_0x28824c,_0x20e2de,_0x49fc10){OpenchannelQueueEvents['emit'](_0x5b58b7+':'+_0x28824c['id'],_0x28824c);OpenchannelQueueEvents[_0x83a5('0x7')](_0x5b58b7,_0x28824c);_0x49fc10(null);};}for(var e in events){if(events[_0x83a5('0x8')](e)){var event=events[e];OpenchannelQueue[_0x83a5('0x9')](e,emitEvent(event));}}module[_0x83a5('0xa')]=OpenchannelQueueEvents;