Built motion from commit a679711e.|2.6.15
[motion2.git] / server / api / smsAccount / smsAccount.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 _0x64ce=['hook','events','../../mysqldb','SmsAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x44951e,_0x2f56a4){var _0x57bf59=function(_0x83574e){while(--_0x83574e){_0x44951e['push'](_0x44951e['shift']());}};_0x57bf59(++_0x2f56a4);}(_0x64ce,0x1a5));var _0xe64c=function(_0x508faf,_0x1792f3){_0x508faf=_0x508faf-0x0;var _0x3b785e=_0x64ce[_0x508faf];return _0x3b785e;};'use strict';var EventEmitter=require(_0xe64c('0x0'));var SmsAccount=require(_0xe64c('0x1'))['db'][_0xe64c('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xe64c('0x3')](0x0);var events={'afterCreate':_0xe64c('0x4'),'afterUpdate':_0xe64c('0x5'),'afterDestroy':_0xe64c('0x6')};function emitEvent(_0x33776b){return function(_0x2c355b,_0x3c64c6,_0x58ab9f){SmsAccountEvents[_0xe64c('0x7')](_0x33776b+':'+_0x2c355b['id'],_0x2c355b);SmsAccountEvents[_0xe64c('0x7')](_0x33776b,_0x2c355b);_0x58ab9f(null);};}for(var e in events){if(events[_0xe64c('0x8')](e)){var event=events[e];SmsAccount[_0xe64c('0x9')](e,emitEvent(event));}}module['exports']=SmsAccountEvents;