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 _0xcb91=['save','update','emit','hasOwnProperty','hook','FaxInteraction','setMaxListeners'];(function(_0x298e9a,_0xba636b){var _0x1132da=function(_0x4e5355){while(--_0x4e5355){_0x298e9a['push'](_0x298e9a['shift']());}};_0x1132da(++_0xba636b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x35fabd,_0x825452){_0x35fabd=_0x35fabd-0x0;var _0x61a8ee=_0xcb91[_0x35fabd];return _0x61a8ee;};'use strict';var EventEmitter=require('events');var FaxInteraction=require('../../mysqldb')['db'][_0x1cb9('0x0')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x1cb9('0x1')](0x0);var events={'afterCreate':_0x1cb9('0x2'),'afterUpdate':_0x1cb9('0x3'),'afterDestroy':'remove'};function emitEvent(_0x8c392f){return function(_0x2c17b8,_0x545a34,_0x13d5fd){FaxInteractionEvents[_0x1cb9('0x4')](_0x8c392f+':'+_0x2c17b8['id'],_0x2c17b8);FaxInteractionEvents['emit'](_0x8c392f,_0x2c17b8);_0x13d5fd(null);};}for(var e in events){if(events[_0x1cb9('0x5')](e)){var event=events[e];FaxInteraction[_0x1cb9('0x6')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents;