1 // *************************************************************************
3 // * xCALLY Motion - The Omnichannel Contact Center *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved *
6 // *************************************************************************
8 // * Email: info@xcally.com *
9 // * Website: https://www.xcally.com *
11 // *************************************************************************
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. *
17 // *************************************************************************
18 var _0xa73f=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxQueue','setMaxListeners','save','update'];(function(_0x34ac35,_0x46f0ce){var _0x71100f=function(_0x188e2f){while(--_0x188e2f){_0x34ac35['push'](_0x34ac35['shift']());}};_0x71100f(++_0x46f0ce);}(_0xa73f,0x162));var _0xfa73=function(_0x4ab5c0,_0x52f019){_0x4ab5c0=_0x4ab5c0-0x0;var _0x111a1e=_0xa73f[_0x4ab5c0];return _0x111a1e;};'use strict';var EventEmitter=require(_0xfa73('0x0'));var FaxQueue=require(_0xfa73('0x1'))['db'][_0xfa73('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xfa73('0x3')](0x0);var events={'afterCreate':_0xfa73('0x4'),'afterUpdate':_0xfa73('0x5'),'afterDestroy':'remove'};function emitEvent(_0x77e5c2){return function(_0x16ac5d,_0x352b07,_0x287422){FaxQueueEvents[_0xfa73('0x6')](_0x77e5c2+':'+_0x16ac5d['id'],_0x16ac5d);FaxQueueEvents[_0xfa73('0x6')](_0x77e5c2,_0x16ac5d);_0x287422(null);};}for(var e in events){if(events[_0xfa73('0x7')](e)){var event=events[e];FaxQueue[_0xfa73('0x8')](e,emitEvent(event));}}module[_0xfa73('0x9')]=FaxQueueEvents;