Built motion from commit 4ffc18b1.|2.6.31
[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 _0x1a66=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1a66,0x175));var _0x61a6=function(_0xe7b4d,_0x19fbb9){_0xe7b4d=_0xe7b4d-0x0;var _0x51ecf3=_0x1a66[_0xe7b4d];return _0x51ecf3;};'use strict';var EventEmitter=require(_0x61a6('0x0'));var FaxQueue=require(_0x61a6('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x61a6('0x2')](0x0);var events={'afterCreate':_0x61a6('0x3'),'afterUpdate':_0x61a6('0x4'),'afterDestroy':_0x61a6('0x5')};function emitEvent(_0x216a7f){return function(_0xc6c228,_0xbcf7a8,_0x26ee3e){FaxQueueEvents['emit'](_0x216a7f+':'+_0xc6c228['id'],_0xc6c228);FaxQueueEvents[_0x61a6('0x6')](_0x216a7f,_0xc6c228);_0x26ee3e(null);};}for(var e in events){if(events[_0x61a6('0x7')](e)){var event=events[e];FaxQueue[_0x61a6('0x8')](e,emitEvent(event));}}module[_0x61a6('0x9')]=FaxQueueEvents;