Built motion from commit 87cd5f02.|2.5.48
[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 _0x3efb=['../../mysqldb','SquareProject','setMaxListeners','emit','hasOwnProperty'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3efb,0x131));var _0xb3ef=function(_0x4b2b03,_0xbf34ee){_0x4b2b03=_0x4b2b03-0x0;var _0x1bf0ed=_0x3efb[_0x4b2b03];return _0x1bf0ed;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0xb3ef('0x0'))['db'][_0xb3ef('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xb3ef('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x439406){return function(_0x5cfbbd,_0x438c97,_0xd7541d){SquareProjectEvents[_0xb3ef('0x3')](_0x439406+':'+_0x5cfbbd['id'],_0x5cfbbd);SquareProjectEvents['emit'](_0x439406,_0x5cfbbd);_0xd7541d(null);};}for(var e in events){if(events[_0xb3ef('0x4')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module['exports']=SquareProjectEvents;