a68c36987579736650ff54f5d996db935bcf428c
[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 _0x25af=['events','../../mysqldb','FaxQueue','setMaxListeners','save','update','emit','hasOwnProperty','exports'];(function(_0x2b603b,_0x47b446){var _0x16ac80=function(_0x401f54){while(--_0x401f54){_0x2b603b['push'](_0x2b603b['shift']());}};_0x16ac80(++_0x47b446);}(_0x25af,0x1a7));var _0xf25a=function(_0x289912,_0x1f4cbf){_0x289912=_0x289912-0x0;var _0x51c21d=_0x25af[_0x289912];return _0x51c21d;};'use strict';var EventEmitter=require(_0xf25a('0x0'));var FaxQueue=require(_0xf25a('0x1'))['db'][_0xf25a('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xf25a('0x3')](0x0);var events={'afterCreate':_0xf25a('0x4'),'afterUpdate':_0xf25a('0x5'),'afterDestroy':'remove'};function emitEvent(_0x29effc){return function(_0x4fb0dd,_0x50c75c,_0x19432a){FaxQueueEvents[_0xf25a('0x6')](_0x29effc+':'+_0x4fb0dd['id'],_0x4fb0dd);FaxQueueEvents['emit'](_0x29effc,_0x4fb0dd);_0x19432a(null);};}for(var e in events){if(events[_0xf25a('0x7')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0xf25a('0x8')]=FaxQueueEvents;