503683b1fca33e201d707ace6957969932a9e888
[motion2.git] / server / api / whatsappAccount / whatsappAccount.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 _0x7206=['hook','exports','events','../../mysqldb','WhatsappAccount','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x5a19fc,_0x58f9f4){var _0x34b413=function(_0x344feb){while(--_0x344feb){_0x5a19fc['push'](_0x5a19fc['shift']());}};_0x34b413(++_0x58f9f4);}(_0x7206,0x66));var _0x6720=function(_0x49b6eb,_0x2308fc){_0x49b6eb=_0x49b6eb-0x0;var _0x21411a=_0x7206[_0x49b6eb];return _0x21411a;};'use strict';var EventEmitter=require(_0x6720('0x0'));var WhatsappAccount=require(_0x6720('0x1'))['db'][_0x6720('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x6720('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6720('0x4'),'afterDestroy':_0x6720('0x5')};function emitEvent(_0x206281){return function(_0x14784e,_0x2e0454,_0x10e7d7){WhatsappAccountEvents[_0x6720('0x6')](_0x206281+':'+_0x14784e['id'],_0x14784e);WhatsappAccountEvents['emit'](_0x206281,_0x14784e);_0x10e7d7(null);};}for(var e in events){if(events[_0x6720('0x7')](e)){var event=events[e];WhatsappAccount[_0x6720('0x8')](e,emitEvent(event));}}module[_0x6720('0x9')]=WhatsappAccountEvents;