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 _0x9fd3=['emit','hasOwnProperty','hook','events','setMaxListeners','save','update'];(function(_0x3a5f73,_0x34cb69){var _0x540267=function(_0x5e6cf3){while(--_0x5e6cf3){_0x3a5f73['push'](_0x3a5f73['shift']());}};_0x540267(++_0x34cb69);}(_0x9fd3,0x137));var _0x39fd=function(_0x1d3c35,_0x38c5f9){_0x1d3c35=_0x1d3c35-0x0;var _0x3b4d05=_0x9fd3[_0x1d3c35];return _0x3b4d05;};'use strict';var EventEmitter=require(_0x39fd('0x0'));var SquareProject=require('../../mysqldb')['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x39fd('0x1')](0x0);var events={'afterCreate':_0x39fd('0x2'),'afterUpdate':_0x39fd('0x3'),'afterDestroy':'remove'};function emitEvent(_0x35517d){return function(_0x23efce,_0x19b453,_0x1fdbac){SquareProjectEvents[_0x39fd('0x4')](_0x35517d+':'+_0x23efce['id'],_0x23efce);SquareProjectEvents[_0x39fd('0x4')](_0x35517d,_0x23efce);_0x1fdbac(null);};}for(var e in events){if(events[_0x39fd('0x5')](e)){var event=events[e];SquareProject[_0x39fd('0x6')](e,emitEvent(event));}}module['exports']=SquareProjectEvents;