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 _0xa767=['hook','events','../../mysqldb','SquareProject','setMaxListeners','save','update','emit'];(function(_0x4e859c,_0xc2b230){var _0x3b571d=function(_0x40c359){while(--_0x40c359){_0x4e859c['push'](_0x4e859c['shift']());}};_0x3b571d(++_0xc2b230);}(_0xa767,0x69));var _0x7a76=function(_0x227d3a,_0xdd23d2){_0x227d3a=_0x227d3a-0x0;var _0x44e9af=_0xa767[_0x227d3a];return _0x44e9af;};'use strict';var EventEmitter=require(_0x7a76('0x0'));var SquareProject=require(_0x7a76('0x1'))['db'][_0x7a76('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x7a76('0x3')](0x0);var events={'afterCreate':_0x7a76('0x4'),'afterUpdate':_0x7a76('0x5'),'afterDestroy':'remove'};function emitEvent(_0x48553d){return function(_0x3e7fc2,_0x56cdb8,_0xfda31){SquareProjectEvents[_0x7a76('0x6')](_0x48553d+':'+_0x3e7fc2['id'],_0x3e7fc2);SquareProjectEvents[_0x7a76('0x6')](_0x48553d,_0x3e7fc2);_0xfda31(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x7a76('0x7')](e,emitEvent(event));}}module['exports']=SquareProjectEvents;