Built motion from commit e6806ed6.|2.6.0
[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 _0x5ee2=['../../mysqldb','SquareProject','setMaxListeners','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x34dcad,_0x7de6bd){var _0x45e95c=function(_0x1a51f2){while(--_0x1a51f2){_0x34dcad['push'](_0x34dcad['shift']());}};_0x45e95c(++_0x7de6bd);}(_0x5ee2,0x14c));var _0x25ee=function(_0x4b9d67,_0x20b5d2){_0x4b9d67=_0x4b9d67-0x0;var _0x57157e=_0x5ee2[_0x4b9d67];return _0x57157e;};'use strict';var EventEmitter=require(_0x25ee('0x0'));var SquareProject=require(_0x25ee('0x1'))['db'][_0x25ee('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x25ee('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x25ee('0x4')};function emitEvent(_0x28ebb6){return function(_0x13986d,_0x353159,_0x79bead){SquareProjectEvents[_0x25ee('0x5')](_0x28ebb6+':'+_0x13986d['id'],_0x13986d);SquareProjectEvents[_0x25ee('0x5')](_0x28ebb6,_0x13986d);_0x79bead(null);};}for(var e in events){if(events[_0x25ee('0x6')](e)){var event=events[e];SquareProject[_0x25ee('0x7')](e,emitEvent(event));}}module[_0x25ee('0x8')]=SquareProjectEvents;