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 _0x14f8=['emit','hasOwnProperty','hook','events','SquareProject','setMaxListeners','save','remove'];(function(_0x455934,_0x526fdc){var _0x3dbc33=function(_0x29a030){while(--_0x29a030){_0x455934['push'](_0x455934['shift']());}};_0x3dbc33(++_0x526fdc);}(_0x14f8,0x193));var _0x814f=function(_0x31f97d,_0x28fdde){_0x31f97d=_0x31f97d-0x0;var _0x4fcde3=_0x14f8[_0x31f97d];return _0x4fcde3;};'use strict';var EventEmitter=require(_0x814f('0x0'));var SquareProject=require('../../mysqldb')['db'][_0x814f('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x814f('0x2')](0x0);var events={'afterCreate':_0x814f('0x3'),'afterUpdate':'update','afterDestroy':_0x814f('0x4')};function emitEvent(_0x128eaf){return function(_0x67eae2,_0x16b516,_0x565035){SquareProjectEvents[_0x814f('0x5')](_0x128eaf+':'+_0x67eae2['id'],_0x67eae2);SquareProjectEvents[_0x814f('0x5')](_0x128eaf,_0x67eae2);_0x565035(null);};}for(var e in events){if(events[_0x814f('0x6')](e)){var event=events[e];SquareProject[_0x814f('0x7')](e,emitEvent(event));}}module['exports']=SquareProjectEvents;