d508e3207e02b817119ef1c63ee842c034721b35
[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 _0xdac5=['OpenchannelQueue','setMaxListeners','save','remove','emit','hook','exports'];(function(_0x22de84,_0x56142b){var _0x54fc49=function(_0x3be7bc){while(--_0x3be7bc){_0x22de84['push'](_0x22de84['shift']());}};_0x54fc49(++_0x56142b);}(_0xdac5,0xfc));var _0x5dac=function(_0x55ecba,_0x3a94e1){_0x55ecba=_0x55ecba-0x0;var _0xfb6474=_0xdac5[_0x55ecba];return _0xfb6474;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require('../../mysqldb')['db'][_0x5dac('0x0')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x5dac('0x1')](0x0);var events={'afterCreate':_0x5dac('0x2'),'afterUpdate':'update','afterDestroy':_0x5dac('0x3')};function emitEvent(_0x451b6f){return function(_0x35e632,_0x3b4bda,_0x530353){OpenchannelQueueEvents[_0x5dac('0x4')](_0x451b6f+':'+_0x35e632['id'],_0x35e632);OpenchannelQueueEvents[_0x5dac('0x4')](_0x451b6f,_0x35e632);_0x530353(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0x5dac('0x5')](e,emitEvent(event));}}module[_0x5dac('0x6')]=OpenchannelQueueEvents;