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 _0x2fa8=['../../mysqldb','SquareProject','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x3181cc,_0x28447f){var _0x547a4a=function(_0x3ede80){while(--_0x3ede80){_0x3181cc['push'](_0x3181cc['shift']());}};_0x547a4a(++_0x28447f);}(_0x2fa8,0x18b));var _0x82fa=function(_0x7077a7,_0x416a4f){_0x7077a7=_0x7077a7-0x0;var _0x194479=_0x2fa8[_0x7077a7];return _0x194479;};'use strict';var EventEmitter=require(_0x82fa('0x0'));var SquareProject=require(_0x82fa('0x1'))['db'][_0x82fa('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x82fa('0x3'),'afterUpdate':'update','afterDestroy':_0x82fa('0x4')};function emitEvent(_0x454cf1){return function(_0x25da1b,_0x4a2f73,_0x403e48){SquareProjectEvents[_0x82fa('0x5')](_0x454cf1+':'+_0x25da1b['id'],_0x25da1b);SquareProjectEvents[_0x82fa('0x5')](_0x454cf1,_0x25da1b);_0x403e48(null);};}for(var e in events){if(events[_0x82fa('0x6')](e)){var event=events[e];SquareProject[_0x82fa('0x7')](e,emitEvent(event));}}module[_0x82fa('0x8')]=SquareProjectEvents;