fc915948547894a5818c173763607f68446b2364
[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 _0x3f85=['hook','exports','events','../../mysqldb','SquareProject','save','update','remove','emit','hasOwnProperty'];(function(_0x89ee68,_0x18ca4d){var _0x1dfd3b=function(_0x2f8d31){while(--_0x2f8d31){_0x89ee68['push'](_0x89ee68['shift']());}};_0x1dfd3b(++_0x18ca4d);}(_0x3f85,0xde));var _0x53f8=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3f85[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0x53f8('0x0'));var SquareProject=require(_0x53f8('0x1'))['db'][_0x53f8('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x53f8('0x3'),'afterUpdate':_0x53f8('0x4'),'afterDestroy':_0x53f8('0x5')};function emitEvent(_0x59725d){return function(_0x8ce459,_0x13ca89,_0x586b4e){SquareProjectEvents[_0x53f8('0x6')](_0x59725d+':'+_0x8ce459['id'],_0x8ce459);SquareProjectEvents[_0x53f8('0x6')](_0x59725d,_0x8ce459);_0x586b4e(null);};}for(var e in events){if(events[_0x53f8('0x7')](e)){var event=events[e];SquareProject[_0x53f8('0x8')](e,emitEvent(event));}}module[_0x53f8('0x9')]=SquareProjectEvents;