e81ca27d988ca923e389d6656f3416f8e7322557
[motion2.git] / server / api / faxQueue / faxQueue.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 _0x3369=['FaxQueue','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x2a8cf5,_0x26689d){var _0x3850a2=function(_0x3b8c72){while(--_0x3b8c72){_0x2a8cf5['push'](_0x2a8cf5['shift']());}};_0x3850a2(++_0x26689d);}(_0x3369,0x11f));var _0x9336=function(_0x4fbf59,_0x3b946e){_0x4fbf59=_0x4fbf59-0x0;var _0x5601ff=_0x3369[_0x4fbf59];return _0x5601ff;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x9336('0x0'))['db'][_0x9336('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x9336('0x2')](0x0);var events={'afterCreate':_0x9336('0x3'),'afterUpdate':_0x9336('0x4'),'afterDestroy':'remove'};function emitEvent(_0x36ff3c){return function(_0x68b92b,_0x44f169,_0x249eb0){FaxQueueEvents['emit'](_0x36ff3c+':'+_0x68b92b['id'],_0x68b92b);FaxQueueEvents[_0x9336('0x5')](_0x36ff3c,_0x68b92b);_0x249eb0(null);};}for(var e in events){if(events[_0x9336('0x6')](e)){var event=events[e];FaxQueue[_0x9336('0x7')](e,emitEvent(event));}}module[_0x9336('0x8')]=FaxQueueEvents;