Built motion from commit (unavailable).|2.5.2
[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 _0x3bef=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','SquareProject','setMaxListeners','save','update','remove'];(function(_0x380ac0,_0x551c0f){var _0x118351=function(_0x53f34e){while(--_0x53f34e){_0x380ac0['push'](_0x380ac0['shift']());}};_0x118351(++_0x551c0f);}(_0x3bef,0x185));var _0xf3be=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3bef[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xf3be('0x0'));var SquareProject=require(_0xf3be('0x1'))['db'][_0xf3be('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xf3be('0x3')](0x0);var events={'afterCreate':_0xf3be('0x4'),'afterUpdate':_0xf3be('0x5'),'afterDestroy':_0xf3be('0x6')};function emitEvent(_0x41f79b){return function(_0x34c0a3,_0x1098df,_0x4c04d2){SquareProjectEvents[_0xf3be('0x7')](_0x41f79b+':'+_0x34c0a3['id'],_0x34c0a3);SquareProjectEvents[_0xf3be('0x7')](_0x41f79b,_0x34c0a3);_0x4c04d2(null);};}for(var e in events){if(events[_0xf3be('0x8')](e)){var event=events[e];SquareProject[_0xf3be('0x9')](e,emitEvent(event));}}module[_0xf3be('0xa')]=SquareProjectEvents;