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 _0xe5b3=['hook','../../mysqldb','SquareProject','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x365fef,_0x12aeba){var _0x309bbb=function(_0xf743e0){while(--_0xf743e0){_0x365fef['push'](_0x365fef['shift']());}};_0x309bbb(++_0x12aeba);}(_0xe5b3,0x133));var _0x3e5b=function(_0x562faa,_0x23adc7){_0x562faa=_0x562faa-0x0;var _0xc70f59=_0xe5b3[_0x562faa];return _0xc70f59;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0x3e5b('0x0'))['db'][_0x3e5b('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x3e5b('0x2')](0x0);var events={'afterCreate':_0x3e5b('0x3'),'afterUpdate':_0x3e5b('0x4'),'afterDestroy':_0x3e5b('0x5')};function emitEvent(_0x7f1cc0){return function(_0x1e58ed,_0x320b1e,_0x4195cb){SquareProjectEvents[_0x3e5b('0x6')](_0x7f1cc0+':'+_0x1e58ed['id'],_0x1e58ed);SquareProjectEvents['emit'](_0x7f1cc0,_0x1e58ed);_0x4195cb(null);};}for(var e in events){if(events[_0x3e5b('0x7')](e)){var event=events[e];SquareProject[_0x3e5b('0x8')](e,emitEvent(event));}}module['exports']=SquareProjectEvents;