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 _0xd803=['hook','exports','events','../../mysqldb','FaxAccount','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x4c3afd,_0x3e7a45){var _0x4e2ef3=function(_0x426053){while(--_0x426053){_0x4c3afd['push'](_0x4c3afd['shift']());}};_0x4e2ef3(++_0x3e7a45);}(_0xd803,0x1ce));var _0x3d80=function(_0x95f6b1,_0x59939d){_0x95f6b1=_0x95f6b1-0x0;var _0xc9b75e=_0xd803[_0x95f6b1];return _0xc9b75e;};'use strict';var EventEmitter=require(_0x3d80('0x0'));var FaxAccount=require(_0x3d80('0x1'))['db'][_0x3d80('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x3d80('0x3')](0x0);var events={'afterCreate':_0x3d80('0x4'),'afterUpdate':_0x3d80('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2353b6){return function(_0x29201f,_0x4c9f71,_0x5b1559){FaxAccountEvents[_0x3d80('0x6')](_0x2353b6+':'+_0x29201f['id'],_0x29201f);FaxAccountEvents[_0x3d80('0x6')](_0x2353b6,_0x29201f);_0x5b1559(null);};}for(var e in events){if(events[_0x3d80('0x7')](e)){var event=events[e];FaxAccount[_0x3d80('0x8')](e,emitEvent(event));}}module[_0x3d80('0x9')]=FaxAccountEvents;