83c21de4ff02480dbc8328fa8f468b28764b2dcb
[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 _0x95d4=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','WhatsappTransferReport,\x20%s,\x20%s','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util'];(function(_0x1d1910,_0x3f1eb4){var _0x398975=function(_0x3c1c4b){while(--_0x3c1c4b){_0x1d1910['push'](_0x1d1910['shift']());}};_0x398975(++_0x3f1eb4);}(_0x95d4,0xa6));var _0x495d=function(_0x27d020,_0x3e50af){_0x27d020=_0x27d020-0x0;var _0x14a24b=_0x95d4[_0x27d020];return _0x14a24b;};'use strict';var _=require(_0x495d('0x0'));var util=require(_0x495d('0x1'));var moment=require(_0x495d('0x2'));var BPromise=require(_0x495d('0x3'));var rs=require(_0x495d('0x4'));var fs=require('fs');var Redis=require(_0x495d('0x5'));var db=require(_0x495d('0x6'))['db'];var utils=require(_0x495d('0x7'));var logger=require('../../config/logger')(_0x495d('0x8'));var config=require(_0x495d('0x9'));var jayson=require(_0x495d('0xa'));var client=jayson[_0x495d('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3147c9,_0x50b24b,_0x4f822a){return new BPromise(function(_0x36d4c5,_0x367b42){return client[_0x495d('0xc')](_0x3147c9,_0x4f822a)['then'](function(_0x308669){logger[_0x495d('0xd')](_0x495d('0xe'),_0x50b24b,'request\x20sent');logger[_0x495d('0xf')](_0x495d('0x10'),_0x50b24b,_0x495d('0x11'),JSON[_0x495d('0x12')](_0x308669));if(_0x308669[_0x495d('0x13')]){if(_0x308669[_0x495d('0x13')][_0x495d('0x14')]===0x1f4){logger[_0x495d('0x13')](_0x495d('0xe'),_0x50b24b,_0x308669[_0x495d('0x13')][_0x495d('0x15')]);return _0x367b42(_0x308669[_0x495d('0x13')][_0x495d('0x15')]);}logger[_0x495d('0x13')](_0x495d('0xe'),_0x50b24b,_0x308669[_0x495d('0x13')][_0x495d('0x15')]);return _0x36d4c5(_0x308669['error'][_0x495d('0x15')]);}else{logger[_0x495d('0xd')]('WhatsappTransferReport,\x20%s,\x20%s',_0x50b24b,_0x495d('0x11'));_0x36d4c5(_0x308669[_0x495d('0x16')]['message']);}})[_0x495d('0x17')](function(_0x268d81){logger[_0x495d('0x13')](_0x495d('0xe'),_0x50b24b,_0x268d81);_0x367b42(_0x268d81);});});}