Built motion from commit 9d7072cc.|2.5.39
[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 _0x72e6=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x1eb471,_0x2f203d){var _0x59522a=function(_0x197df9){while(--_0x197df9){_0x1eb471['push'](_0x1eb471['shift']());}};_0x59522a(++_0x2f203d);}(_0x72e6,0x66));var _0x672e=function(_0xc8acd8,_0x1075b3){_0xc8acd8=_0xc8acd8-0x0;var _0x312f16=_0x72e6[_0xc8acd8];return _0x312f16;};'use strict';var EventEmitter=require(_0x672e('0x0'));var FaxQueue=require(_0x672e('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x672e('0x2')](0x0);var events={'afterCreate':_0x672e('0x3'),'afterUpdate':_0x672e('0x4'),'afterDestroy':_0x672e('0x5')};function emitEvent(_0x34686c){return function(_0x51379b,_0x1f73bc,_0x3dcf4c){FaxQueueEvents[_0x672e('0x6')](_0x34686c+':'+_0x51379b['id'],_0x51379b);FaxQueueEvents[_0x672e('0x6')](_0x34686c,_0x51379b);_0x3dcf4c(null);};}for(var e in events){if(events[_0x672e('0x7')](e)){var event=events[e];FaxQueue[_0x672e('0x8')](e,emitEvent(event));}}module[_0x672e('0x9')]=FaxQueueEvents;