Built motion from commit (unavailable).|2.5.4
[motion2.git] / server / api / squareProject / squareProject.events.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
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.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x7e57=['setMaxListeners','save','update','emit','hasOwnProperty','hook','../../mysqldb','SquareProject'];(function(_0x22f8ab,_0x15d8ff){var _0x2a70e5=function(_0x5e6895){while(--_0x5e6895){_0x22f8ab['push'](_0x22f8ab['shift']());}};_0x2a70e5(++_0x15d8ff);}(_0x7e57,0xf6));var _0x77e5=function(_0x3d2723,_0x2cc81e){_0x3d2723=_0x3d2723-0x0;var _0x28c50f=_0x7e57[_0x3d2723];return _0x28c50f;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0x77e5('0x0'))['db'][_0x77e5('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x77e5('0x2')](0x0);var events={'afterCreate':_0x77e5('0x3'),'afterUpdate':_0x77e5('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4ea3c6){return function(_0x18365d,_0x2bb36e,_0x2efd66){SquareProjectEvents[_0x77e5('0x5')](_0x4ea3c6+':'+_0x18365d['id'],_0x18365d);SquareProjectEvents[_0x77e5('0x5')](_0x4ea3c6,_0x18365d);_0x2efd66(null);};}for(var e in events){if(events[_0x77e5('0x6')](e)){var event=events[e];SquareProject[_0x77e5('0x7')](e,emitEvent(event));}}module['exports']=SquareProjectEvents;