Built motion from commit da617fac.|2.6.6
[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 _0x7d30=['exports','events','../../mysqldb','SquareProject','setMaxListeners','save','update','hasOwnProperty','hook'];(function(_0x3f4891,_0x4e6f62){var _0x54f2d8=function(_0x2b11ee){while(--_0x2b11ee){_0x3f4891['push'](_0x3f4891['shift']());}};_0x54f2d8(++_0x4e6f62);}(_0x7d30,0xb5));var _0x07d3=function(_0x378289,_0x163424){_0x378289=_0x378289-0x0;var _0x47c851=_0x7d30[_0x378289];return _0x47c851;};'use strict';var EventEmitter=require(_0x07d3('0x0'));var SquareProject=require(_0x07d3('0x1'))['db'][_0x07d3('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x07d3('0x3')](0x0);var events={'afterCreate':_0x07d3('0x4'),'afterUpdate':_0x07d3('0x5'),'afterDestroy':'remove'};function emitEvent(_0x7a2520){return function(_0xcc0a34,_0x8b2f46,_0xcd3bab){SquareProjectEvents['emit'](_0x7a2520+':'+_0xcc0a34['id'],_0xcc0a34);SquareProjectEvents['emit'](_0x7a2520,_0xcc0a34);_0xcd3bab(null);};}for(var e in events){if(events[_0x07d3('0x6')](e)){var event=events[e];SquareProject[_0x07d3('0x7')](e,emitEvent(event));}}module[_0x07d3('0x8')]=SquareProjectEvents;