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 _0xeb7e=['emit','hasOwnProperty','hook','events','../../mysqldb','FaxAccount','setMaxListeners','save','update'];(function(_0x1c55cf,_0xb7f596){var _0x221da7=function(_0x4d46fc){while(--_0x4d46fc){_0x1c55cf['push'](_0x1c55cf['shift']());}};_0x221da7(++_0xb7f596);}(_0xeb7e,0x1f2));var _0xeeb7=function(_0x1217a4,_0x5d603f){_0x1217a4=_0x1217a4-0x0;var _0x898fb2=_0xeb7e[_0x1217a4];return _0x898fb2;};'use strict';var EventEmitter=require(_0xeeb7('0x0'));var FaxAccount=require(_0xeeb7('0x1'))['db'][_0xeeb7('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xeeb7('0x3')](0x0);var events={'afterCreate':_0xeeb7('0x4'),'afterUpdate':_0xeeb7('0x5'),'afterDestroy':'remove'};function emitEvent(_0x23c03f){return function(_0x277faa,_0x198cd2,_0x5e0121){FaxAccountEvents[_0xeeb7('0x6')](_0x23c03f+':'+_0x277faa['id'],_0x277faa);FaxAccountEvents[_0xeeb7('0x6')](_0x23c03f,_0x277faa);_0x5e0121(null);};}for(var e in events){if(events[_0xeeb7('0x7')](e)){var event=events[e];FaxAccount[_0xeeb7('0x8')](e,emitEvent(event));}}module['exports']=FaxAccountEvents;