Built motion from commit c738b9ac.|2.6.25
[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 _0x2af7=['hook','exports','events','../../mysqldb','FaxQueue','emit'];(function(_0x120376,_0x571898){var _0x28c529=function(_0x4f130c){while(--_0x4f130c){_0x120376['push'](_0x120376['shift']());}};_0x28c529(++_0x571898);}(_0x2af7,0xda));var _0x72af=function(_0x3a6cd0,_0xb14e58){_0x3a6cd0=_0x3a6cd0-0x0;var _0x2c8932=_0x2af7[_0x3a6cd0];return _0x2c8932;};'use strict';var EventEmitter=require(_0x72af('0x0'));var FaxQueue=require(_0x72af('0x1'))['db'][_0x72af('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5af0eb){return function(_0x2882aa,_0x223a1c,_0x5535e7){FaxQueueEvents[_0x72af('0x3')](_0x5af0eb+':'+_0x2882aa['id'],_0x2882aa);FaxQueueEvents[_0x72af('0x3')](_0x5af0eb,_0x2882aa);_0x5535e7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0x72af('0x4')](e,emitEvent(event));}}module[_0x72af('0x5')]=FaxQueueEvents;