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 _0x064a=['events','../../mysqldb','SquareProject','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x284c63,_0x447719){var _0x51b5cd=function(_0x14b48c){while(--_0x14b48c){_0x284c63['push'](_0x284c63['shift']());}};_0x51b5cd(++_0x447719);}(_0x064a,0x17c));var _0xa064=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x064a[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0xa064('0x0'));var SquareProject=require(_0xa064('0x1'))['db'][_0xa064('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xa064('0x3')](0x0);var events={'afterCreate':_0xa064('0x4'),'afterUpdate':_0xa064('0x5'),'afterDestroy':_0xa064('0x6')};function emitEvent(_0x3f551a){return function(_0x7f8883,_0x333481,_0x3d0ddc){SquareProjectEvents[_0xa064('0x7')](_0x3f551a+':'+_0x7f8883['id'],_0x7f8883);SquareProjectEvents[_0xa064('0x7')](_0x3f551a,_0x7f8883);_0x3d0ddc(null);};}for(var e in events){if(events[_0xa064('0x8')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0xa064('0x9')]=SquareProjectEvents;