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 _0xfd7f=['../../mysqldb','SquareProject','emit','hasOwnProperty','hook','exports'];(function(_0x5af709,_0x1481ca){var _0x190c50=function(_0x2bb2fb){while(--_0x2bb2fb){_0x5af709['push'](_0x5af709['shift']());}};_0x190c50(++_0x1481ca);}(_0xfd7f,0xba));var _0xffd7=function(_0x3cd975,_0x23f21f){_0x3cd975=_0x3cd975-0x0;var _0x579111=_0xfd7f[_0x3cd975];return _0x579111;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0xffd7('0x0'))['db'][_0xffd7('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1c1c19){return function(_0x25ace8,_0x250571,_0x172f17){SquareProjectEvents[_0xffd7('0x2')](_0x1c1c19+':'+_0x25ace8['id'],_0x25ace8);SquareProjectEvents[_0xffd7('0x2')](_0x1c1c19,_0x25ace8);_0x172f17(null);};}for(var e in events){if(events[_0xffd7('0x3')](e)){var event=events[e];SquareProject[_0xffd7('0x4')](e,emitEvent(event));}}module[_0xffd7('0x5')]=SquareProjectEvents;