51321da45281728f7350c9e870841e76d1be0501
[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 _0x98cb=['setMaxListeners','save','remove','emit','events','../../mysqldb','FaxQueue'];(function(_0x28cfbd,_0x2f69a5){var _0x1d206b=function(_0x20c1b4){while(--_0x20c1b4){_0x28cfbd['push'](_0x28cfbd['shift']());}};_0x1d206b(++_0x2f69a5);}(_0x98cb,0x66));var _0xb98c=function(_0x3b3628,_0x365d8e){_0x3b3628=_0x3b3628-0x0;var _0x573b6b=_0x98cb[_0x3b3628];return _0x573b6b;};'use strict';var EventEmitter=require(_0xb98c('0x0'));var FaxQueue=require(_0xb98c('0x1'))['db'][_0xb98c('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xb98c('0x3')](0x0);var events={'afterCreate':_0xb98c('0x4'),'afterUpdate':'update','afterDestroy':_0xb98c('0x5')};function emitEvent(_0x11a919){return function(_0x5c6457,_0x3dd5b0,_0x1c8dc0){FaxQueueEvents['emit'](_0x11a919+':'+_0x5c6457['id'],_0x5c6457);FaxQueueEvents[_0xb98c('0x6')](_0x11a919,_0x5c6457);_0x1c8dc0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module['exports']=FaxQueueEvents;