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 _0xbc0e=['hasOwnProperty','hook','../../mysqldb','SquareProject','setMaxListeners','update','remove','emit'];(function(_0xac7bc9,_0x1b525f){var _0x29b35c=function(_0x1ff37e){while(--_0x1ff37e){_0xac7bc9['push'](_0xac7bc9['shift']());}};_0x29b35c(++_0x1b525f);}(_0xbc0e,0x82));var _0xebc0=function(_0x3485de,_0x319486){_0x3485de=_0x3485de-0x0;var _0x21551f=_0xbc0e[_0x3485de];return _0x21551f;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0xebc0('0x0'))['db'][_0xebc0('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xebc0('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xebc0('0x3'),'afterDestroy':_0xebc0('0x4')};function emitEvent(_0x2b94ce){return function(_0x24579c,_0x15a928,_0x17421b){SquareProjectEvents[_0xebc0('0x5')](_0x2b94ce+':'+_0x24579c['id'],_0x24579c);SquareProjectEvents['emit'](_0x2b94ce,_0x24579c);_0x17421b(null);};}for(var e in events){if(events[_0xebc0('0x6')](e)){var event=events[e];SquareProject[_0xebc0('0x7')](e,emitEvent(event));}}module['exports']=SquareProjectEvents;