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 _0xf55b=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x41c544,_0x413c5c){var _0x3f8116=function(_0x427e9c){while(--_0x427e9c){_0x41c544['push'](_0x41c544['shift']());}};_0x3f8116(++_0x413c5c);}(_0xf55b,0x1c4));var _0xbf55=function(_0x4e7d18,_0x4e11ff){_0x4e7d18=_0x4e7d18-0x0;var _0x2f9d69=_0xf55b[_0x4e7d18];return _0x2f9d69;};'use strict';var EventEmitter=require(_0xbf55('0x0'));var FaxMessage=require(_0xbf55('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xbf55('0x2')](0x0);var events={'afterCreate':_0xbf55('0x3'),'afterUpdate':_0xbf55('0x4'),'afterDestroy':_0xbf55('0x5')};function emitEvent(_0x5a299d){return function(_0x173604,_0xf5dd3b,_0x4feacb){FaxMessageEvents[_0xbf55('0x6')](_0x5a299d+':'+_0x173604['id'],_0x173604);FaxMessageEvents[_0xbf55('0x6')](_0x5a299d,_0x173604);_0x4feacb(null);};}for(var e in events){if(events[_0xbf55('0x7')](e)){var event=events[e];FaxMessage[_0xbf55('0x8')](e,emitEvent(event));}}module[_0xbf55('0x9')]=FaxMessageEvents;