Built motion from commit fe909640.|2.6.8
[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 _0x15b3=['jayson/promise','client','http','request','then','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x151770,_0x4eba62){var _0x5c3ddb=function(_0x3367b6){while(--_0x3367b6){_0x151770['push'](_0x151770['shift']());}};_0x5c3ddb(++_0x4eba62);}(_0x15b3,0x153));var _0x315b=function(_0x4e13fd,_0x2ae141){_0x4e13fd=_0x4e13fd-0x0;var _0x182114=_0x15b3[_0x4e13fd];return _0x182114;};'use strict';var _=require(_0x315b('0x0'));var util=require(_0x315b('0x1'));var moment=require(_0x315b('0x2'));var BPromise=require(_0x315b('0x3'));var rs=require(_0x315b('0x4'));var fs=require('fs');var Redis=require(_0x315b('0x5'));var db=require(_0x315b('0x6'))['db'];var utils=require(_0x315b('0x7'));var logger=require(_0x315b('0x8'))(_0x315b('0x9'));var config=require(_0x315b('0xa'));var jayson=require(_0x315b('0xb'));var client=jayson[_0x315b('0xc')][_0x315b('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1b8914,_0xf465f9,_0x21a94d){return new BPromise(function(_0x2af63e,_0x2d76ab){return client[_0x315b('0xe')](_0x1b8914,_0x21a94d)[_0x315b('0xf')](function(_0x565df9){logger['info'](_0x315b('0x10'),_0xf465f9,_0x315b('0x11'));logger[_0x315b('0x12')](_0x315b('0x13'),_0xf465f9,_0x315b('0x11'),JSON[_0x315b('0x14')](_0x565df9));if(_0x565df9[_0x315b('0x15')]){if(_0x565df9[_0x315b('0x15')]['code']===0x1f4){logger[_0x315b('0x15')](_0x315b('0x10'),_0xf465f9,_0x565df9[_0x315b('0x15')]['message']);return _0x2d76ab(_0x565df9['error'][_0x315b('0x16')]);}logger[_0x315b('0x15')](_0x315b('0x10'),_0xf465f9,_0x565df9[_0x315b('0x15')]['message']);return _0x2af63e(_0x565df9[_0x315b('0x15')][_0x315b('0x16')]);}else{logger[_0x315b('0x17')]('WhatsappTransferReport,\x20%s,\x20%s',_0xf465f9,_0x315b('0x11'));_0x2af63e(_0x565df9['result'][_0x315b('0x16')]);}})[_0x315b('0x18')](function(_0x6aeed2){logger[_0x315b('0x15')](_0x315b('0x10'),_0xf465f9,_0x6aeed2);_0x2d76ab(_0x6aeed2);});});}