Built motion from commit e0fa946e.|2.6.5
[motion2.git] / server / api / whatsappTransferReport / whatsappTransferReport.rpc.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 _0x7a65=['ioredis','../../mysqldb','../../config/utils','rpc','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x980d62,_0x560343){var _0x22201c=function(_0x45392f){while(--_0x45392f){_0x980d62['push'](_0x980d62['shift']());}};_0x22201c(++_0x560343);}(_0x7a65,0x146));var _0x57a6=function(_0x31623e,_0x6e746d){_0x31623e=_0x31623e-0x0;var _0x559711=_0x7a65[_0x31623e];return _0x559711;};'use strict';var _=require(_0x57a6('0x0'));var util=require(_0x57a6('0x1'));var moment=require(_0x57a6('0x2'));var BPromise=require(_0x57a6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x57a6('0x4'));var db=require(_0x57a6('0x5'))['db'];var utils=require(_0x57a6('0x6'));var logger=require('../../config/logger')(_0x57a6('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x57a6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x31eeee,_0x1f1075,_0x5855df){return new BPromise(function(_0x4ff4e4,_0x44ddf6){return client[_0x57a6('0x9')](_0x31eeee,_0x5855df)[_0x57a6('0xa')](function(_0x17cc6e){logger[_0x57a6('0xb')](_0x57a6('0xc'),_0x1f1075,_0x57a6('0xd'));logger[_0x57a6('0xe')](_0x57a6('0xf'),_0x1f1075,_0x57a6('0xd'),JSON[_0x57a6('0x10')](_0x17cc6e));if(_0x17cc6e[_0x57a6('0x11')]){if(_0x17cc6e[_0x57a6('0x11')][_0x57a6('0x12')]===0x1f4){logger[_0x57a6('0x11')](_0x57a6('0xc'),_0x1f1075,_0x17cc6e[_0x57a6('0x11')][_0x57a6('0x13')]);return _0x44ddf6(_0x17cc6e[_0x57a6('0x11')][_0x57a6('0x13')]);}logger['error'](_0x57a6('0xc'),_0x1f1075,_0x17cc6e['error']['message']);return _0x4ff4e4(_0x17cc6e['error'][_0x57a6('0x13')]);}else{logger['info']('WhatsappTransferReport,\x20%s,\x20%s',_0x1f1075,_0x57a6('0xd'));_0x4ff4e4(_0x17cc6e[_0x57a6('0x14')]['message']);}})[_0x57a6('0x15')](function(_0x64f783){logger[_0x57a6('0x11')]('WhatsappTransferReport,\x20%s,\x20%s',_0x1f1075,_0x64f783);_0x44ddf6(_0x64f783);});});}