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 _0xe35e=['../../mysqldb','SquareProject','setMaxListeners','emit','hasOwnProperty','hook','exports'];(function(_0x4f1184,_0x39166d){var _0x4e165d=function(_0x5329fb){while(--_0x5329fb){_0x4f1184['push'](_0x4f1184['shift']());}};_0x4e165d(++_0x39166d);}(_0xe35e,0xfc));var _0xee35=function(_0x289e64,_0x5adb3c){_0x289e64=_0x289e64-0x0;var _0x30246c=_0xe35e[_0x289e64];return _0x30246c;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0xee35('0x0'))['db'][_0xee35('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xee35('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2bce91){return function(_0x4ac77f,_0x5f4caf,_0x1831e8){SquareProjectEvents[_0xee35('0x3')](_0x2bce91+':'+_0x4ac77f['id'],_0x4ac77f);SquareProjectEvents['emit'](_0x2bce91,_0x4ac77f);_0x1831e8(null);};}for(var e in events){if(events[_0xee35('0x4')](e)){var event=events[e];SquareProject[_0xee35('0x5')](e,emitEvent(event));}}module[_0xee35('0x6')]=SquareProjectEvents;