Built motion from commit (unavailable).|2.3.4
[motion2.git] / server / api / openchannelAccount / openchannelAccount.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 _0x7f53=['events','../../mysqldb','setMaxListeners','save','update','emit','hook','exports'];(function(_0x52523c,_0x25ebc2){var _0x2e01cb=function(_0x26b8fb){while(--_0x26b8fb){_0x52523c['push'](_0x52523c['shift']());}};_0x2e01cb(++_0x25ebc2);}(_0x7f53,0xc0));var _0x37f5=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x7f53[_0x4c12ec];return _0x3ae42c;};'use strict';var EventEmitter=require(_0x37f5('0x0'));var OpenchannelAccount=require(_0x37f5('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x37f5('0x2')](0x0);var events={'afterCreate':_0x37f5('0x3'),'afterUpdate':_0x37f5('0x4'),'afterDestroy':'remove'};function emitEvent(_0xd14b8a){return function(_0x5be3c3,_0x362dd7,_0x3c3860){OpenchannelAccountEvents[_0x37f5('0x5')](_0xd14b8a+':'+_0x5be3c3['id'],_0x5be3c3);OpenchannelAccountEvents[_0x37f5('0x5')](_0xd14b8a,_0x5be3c3);_0x3c3860(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x37f5('0x6')](e,emitEvent(event));}}module[_0x37f5('0x7')]=OpenchannelAccountEvents;