616e3fa202e649dfd0623f63755d20b7b286652d
[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 _0x597a=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x5d4627,_0xc5da95){var _0x10cb8f=function(_0x340fda){while(--_0x340fda){_0x5d4627['push'](_0x5d4627['shift']());}};_0x10cb8f(++_0xc5da95);}(_0x597a,0x66));var _0xa597=function(_0x34e752,_0x32e2a2){_0x34e752=_0x34e752-0x0;var _0x7c6347=_0x597a[_0x34e752];return _0x7c6347;};'use strict';var EventEmitter=require(_0xa597('0x0'));var SquareProject=require(_0xa597('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xa597('0x2')](0x0);var events={'afterCreate':_0xa597('0x3'),'afterUpdate':_0xa597('0x4'),'afterDestroy':_0xa597('0x5')};function emitEvent(_0x20c0db){return function(_0x51d0f7,_0x20fa49,_0x24a045){SquareProjectEvents[_0xa597('0x6')](_0x20c0db+':'+_0x51d0f7['id'],_0x51d0f7);SquareProjectEvents[_0xa597('0x6')](_0x20c0db,_0x51d0f7);_0x24a045(null);};}for(var e in events){if(events[_0xa597('0x7')](e)){var event=events[e];SquareProject[_0xa597('0x8')](e,emitEvent(event));}}module[_0xa597('0x9')]=SquareProjectEvents;