Built motion from commit d5e4af8c.|2.6.23
[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 _0x4731=['../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','error','WhatsappTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x18e239,_0x209392){var _0x5a2d22=function(_0x58e8cf){while(--_0x58e8cf){_0x18e239['push'](_0x18e239['shift']());}};_0x5a2d22(++_0x209392);}(_0x4731,0x65));var _0x1473=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x4731[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x1473('0x0'));var util=require(_0x1473('0x1'));var moment=require(_0x1473('0x2'));var BPromise=require(_0x1473('0x3'));var rs=require(_0x1473('0x4'));var fs=require('fs');var Redis=require(_0x1473('0x5'));var db=require(_0x1473('0x6'))['db'];var utils=require(_0x1473('0x7'));var logger=require(_0x1473('0x8'))('rpc');var config=require(_0x1473('0x9'));var jayson=require(_0x1473('0xa'));var client=jayson[_0x1473('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1dd214,_0x403b41,_0x145094){return new BPromise(function(_0xc160df,_0x2d3969){return client[_0x1473('0xc')](_0x1dd214,_0x145094)['then'](function(_0x421959){logger[_0x1473('0xd')]('WhatsappTransferReport,\x20%s,\x20%s',_0x403b41,_0x1473('0xe'));logger[_0x1473('0xf')](_0x1473('0x10'),_0x403b41,'request\x20sent',JSON['stringify'](_0x421959));if(_0x421959[_0x1473('0x11')]){if(_0x421959[_0x1473('0x11')]['code']===0x1f4){logger['error'](_0x1473('0x12'),_0x403b41,_0x421959[_0x1473('0x11')][_0x1473('0x13')]);return _0x2d3969(_0x421959[_0x1473('0x11')][_0x1473('0x13')]);}logger['error'](_0x1473('0x12'),_0x403b41,_0x421959[_0x1473('0x11')][_0x1473('0x13')]);return _0xc160df(_0x421959[_0x1473('0x11')][_0x1473('0x13')]);}else{logger[_0x1473('0xd')](_0x1473('0x12'),_0x403b41,_0x1473('0xe'));_0xc160df(_0x421959[_0x1473('0x14')]['message']);}})[_0x1473('0x15')](function(_0xc5726e){logger[_0x1473('0x11')](_0x1473('0x12'),_0x403b41,_0xc5726e);_0x2d3969(_0xc5726e);});});}