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 _0x3b84=['setMaxListeners','emit','hasOwnProperty','hook','events','SquareProject'];(function(_0x451ee7,_0x45c553){var _0x123ee7=function(_0x3c57d3){while(--_0x3c57d3){_0x451ee7['push'](_0x451ee7['shift']());}};_0x123ee7(++_0x45c553);}(_0x3b84,0x130));var _0x43b8=function(_0xf7344,_0x2e82b){_0xf7344=_0xf7344-0x0;var _0x330729=_0x3b84[_0xf7344];return _0x330729;};'use strict';var EventEmitter=require(_0x43b8('0x0'));var SquareProject=require('../../mysqldb')['db'][_0x43b8('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x43b8('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x402b07){return function(_0x2c7466,_0x4ec7e3,_0x4b70e2){SquareProjectEvents[_0x43b8('0x3')](_0x402b07+':'+_0x2c7466['id'],_0x2c7466);SquareProjectEvents[_0x43b8('0x3')](_0x402b07,_0x2c7466);_0x4b70e2(null);};}for(var e in events){if(events[_0x43b8('0x4')](e)){var event=events[e];SquareProject[_0x43b8('0x5')](e,emitEvent(event));}}module['exports']=SquareProjectEvents;