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 _0x71e2=['hook','events','../../mysqldb','SquareProject','save','update','emit','hasOwnProperty'];(function(_0x61d2b6,_0x223ae5){var _0x136fa2=function(_0x22f891){while(--_0x22f891){_0x61d2b6['push'](_0x61d2b6['shift']());}};_0x136fa2(++_0x223ae5);}(_0x71e2,0x111));var _0x271e=function(_0x2566d0,_0x2fb01f){_0x2566d0=_0x2566d0-0x0;var _0x7a23ca=_0x71e2[_0x2566d0];return _0x7a23ca;};'use strict';var EventEmitter=require(_0x271e('0x0'));var SquareProject=require(_0x271e('0x1'))['db'][_0x271e('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x271e('0x3'),'afterUpdate':_0x271e('0x4'),'afterDestroy':'remove'};function emitEvent(_0x381a4e){return function(_0x1f9c7b,_0x12cccd,_0x3d2b30){SquareProjectEvents[_0x271e('0x5')](_0x381a4e+':'+_0x1f9c7b['id'],_0x1f9c7b);SquareProjectEvents[_0x271e('0x5')](_0x381a4e,_0x1f9c7b);_0x3d2b30(null);};}for(var e in events){if(events[_0x271e('0x6')](e)){var event=events[e];SquareProject[_0x271e('0x7')](e,emitEvent(event));}}module['exports']=SquareProjectEvents;