Built motion from commit d1eab355.|2.6.28
[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 _0xd5b9=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SquareProject','setMaxListeners','save'];(function(_0x17e7dd,_0x444fcd){var _0x988be0=function(_0x4c23cf){while(--_0x4c23cf){_0x17e7dd['push'](_0x17e7dd['shift']());}};_0x988be0(++_0x444fcd);}(_0xd5b9,0x69));var _0x9d5b=function(_0x4e5163,_0x4b99d8){_0x4e5163=_0x4e5163-0x0;var _0x44fbf7=_0xd5b9[_0x4e5163];return _0x44fbf7;};'use strict';var EventEmitter=require(_0x9d5b('0x0'));var SquareProject=require(_0x9d5b('0x1'))['db'][_0x9d5b('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x9d5b('0x3')](0x0);var events={'afterCreate':_0x9d5b('0x4'),'afterUpdate':_0x9d5b('0x5'),'afterDestroy':'remove'};function emitEvent(_0x136252){return function(_0x53c454,_0x272f4e,_0x453e44){SquareProjectEvents[_0x9d5b('0x6')](_0x136252+':'+_0x53c454['id'],_0x53c454);SquareProjectEvents[_0x9d5b('0x6')](_0x136252,_0x53c454);_0x453e44(null);};}for(var e in events){if(events[_0x9d5b('0x7')](e)){var event=events[e];SquareProject[_0x9d5b('0x8')](e,emitEvent(event));}}module[_0x9d5b('0x9')]=SquareProjectEvents;