b511da3a40330a81d2b74b8adcd45d2602ec1384
[motion2.git] / server / api / voiceQueue / voiceQueue.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 _0xcabe=['emit','exports','events','VoiceQueue','setMaxListeners','remove'];(function(_0x3db122,_0x5e6bee){var _0x325b67=function(_0x5095af){while(--_0x5095af){_0x3db122['push'](_0x3db122['shift']());}};_0x325b67(++_0x5e6bee);}(_0xcabe,0x18e));var _0xecab=function(_0x39a1ee,_0x3ec302){_0x39a1ee=_0x39a1ee-0x0;var _0x4a891f=_0xcabe[_0x39a1ee];return _0x4a891f;};'use strict';var EventEmitter=require(_0xecab('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0xecab('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xecab('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xecab('0x3')};function emitEvent(_0x17cd3e){return function(_0x408c90,_0x3bec0c,_0x300d68){VoiceQueueEvents[_0xecab('0x4')](_0x17cd3e+':'+_0x408c90['id'],_0x408c90);VoiceQueueEvents[_0xecab('0x4')](_0x17cd3e,_0x408c90);_0x300d68(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0xecab('0x5')]=VoiceQueueEvents;