Built motion from commit 0900f080.|2.5.45
[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 _0x45ca=['exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x3299d1,_0x545733){var _0x44356e=function(_0x52fd77){while(--_0x52fd77){_0x3299d1['push'](_0x3299d1['shift']());}};_0x44356e(++_0x545733);}(_0x45ca,0x191));var _0xa45c=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x45ca[_0x502c7d];return _0x30b7ed;};'use strict';var EventEmitter=require(_0xa45c('0x0'));var SquareProject=require(_0xa45c('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xa45c('0x2')](0x0);var events={'afterCreate':_0xa45c('0x3'),'afterUpdate':_0xa45c('0x4'),'afterDestroy':_0xa45c('0x5')};function emitEvent(_0x481c79){return function(_0x19b323,_0x570ab3,_0x57baf2){SquareProjectEvents[_0xa45c('0x6')](_0x481c79+':'+_0x19b323['id'],_0x19b323);SquareProjectEvents[_0xa45c('0x6')](_0x481c79,_0x19b323);_0x57baf2(null);};}for(var e in events){if(events[_0xa45c('0x7')](e)){var event=events[e];SquareProject[_0xa45c('0x8')](e,emitEvent(event));}}module[_0xa45c('0x9')]=SquareProjectEvents;