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 _0x7610=['emit','hook','exports','events','../../mysqldb','SquareProject','setMaxListeners','remove'];(function(_0x549e70,_0x8a5460){var _0x9a9d8c=function(_0x3408c5){while(--_0x3408c5){_0x549e70['push'](_0x549e70['shift']());}};_0x9a9d8c(++_0x8a5460);}(_0x7610,0x123));var _0x0761=function(_0x310fd6,_0x1c93df){_0x310fd6=_0x310fd6-0x0;var _0xca2ad3=_0x7610[_0x310fd6];return _0xca2ad3;};'use strict';var EventEmitter=require(_0x0761('0x0'));var SquareProject=require(_0x0761('0x1'))['db'][_0x0761('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x0761('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x0761('0x4')};function emitEvent(_0x3b3bb9){return function(_0x4f1eb6,_0x1a2b34,_0x21f61a){SquareProjectEvents['emit'](_0x3b3bb9+':'+_0x4f1eb6['id'],_0x4f1eb6);SquareProjectEvents[_0x0761('0x5')](_0x3b3bb9,_0x4f1eb6);_0x21f61a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x0761('0x6')](e,emitEvent(event));}}module[_0x0761('0x7')]=SquareProjectEvents;