977ba08f74fc4a6d9391c259932654b7ecfcd16d
[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 _0xe19e=['events','../../mysqldb','FaxQueue','setMaxListeners','update','remove','emit','hook','exports'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0xe19e,0x105));var _0xee19=function(_0x557bfa,_0x206f0c){_0x557bfa=_0x557bfa-0x0;var _0x1b5bde=_0xe19e[_0x557bfa];return _0x1b5bde;};'use strict';var EventEmitter=require(_0xee19('0x0'));var FaxQueue=require(_0xee19('0x1'))['db'][_0xee19('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xee19('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xee19('0x4'),'afterDestroy':_0xee19('0x5')};function emitEvent(_0x2470f0){return function(_0x593d8d,_0x4b8b2c,_0xa71d8c){FaxQueueEvents['emit'](_0x2470f0+':'+_0x593d8d['id'],_0x593d8d);FaxQueueEvents[_0xee19('0x6')](_0x2470f0,_0x593d8d);_0xa71d8c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0xee19('0x7')](e,emitEvent(event));}}module[_0xee19('0x8')]=FaxQueueEvents;