Built motion from commit 9d7072cc.|2.5.39
[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 _0xbf3c=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash','moment'];(function(_0x8051d7,_0x263ba9){var _0x3fb835=function(_0x3605a6){while(--_0x3605a6){_0x8051d7['push'](_0x8051d7['shift']());}};_0x3fb835(++_0x263ba9);}(_0xbf3c,0x163));var _0xcbf3=function(_0x5235b8,_0xfd1b15){_0x5235b8=_0x5235b8-0x0;var _0x1360dd=_0xbf3c[_0x5235b8];return _0x1360dd;};'use strict';var _=require(_0xcbf3('0x0'));var util=require('util');var moment=require(_0xcbf3('0x1'));var BPromise=require(_0xcbf3('0x2'));var rs=require(_0xcbf3('0x3'));var fs=require('fs');var Redis=require(_0xcbf3('0x4'));var db=require(_0xcbf3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcbf3('0x6'))(_0xcbf3('0x7'));var config=require(_0xcbf3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xcbf3('0x9')][_0xcbf3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x334ec1,_0x22797b,_0x165ebc){return new BPromise(function(_0x2d3d99,_0x204e04){return client[_0xcbf3('0xb')](_0x334ec1,_0x165ebc)[_0xcbf3('0xc')](function(_0x3099ef){logger[_0xcbf3('0xd')](_0xcbf3('0xe'),_0x22797b,_0xcbf3('0xf'));logger[_0xcbf3('0x10')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x22797b,_0xcbf3('0xf'),JSON['stringify'](_0x3099ef));if(_0x3099ef['error']){if(_0x3099ef[_0xcbf3('0x11')][_0xcbf3('0x12')]===0x1f4){logger[_0xcbf3('0x11')](_0xcbf3('0xe'),_0x22797b,_0x3099ef[_0xcbf3('0x11')][_0xcbf3('0x13')]);return _0x204e04(_0x3099ef[_0xcbf3('0x11')][_0xcbf3('0x13')]);}logger[_0xcbf3('0x11')](_0xcbf3('0xe'),_0x22797b,_0x3099ef[_0xcbf3('0x11')][_0xcbf3('0x13')]);return _0x2d3d99(_0x3099ef['error'][_0xcbf3('0x13')]);}else{logger[_0xcbf3('0xd')]('WhatsappTransferReport,\x20%s,\x20%s',_0x22797b,'request\x20sent');_0x2d3d99(_0x3099ef[_0xcbf3('0x14')][_0xcbf3('0x13')]);}})['catch'](function(_0x148c95){logger[_0xcbf3('0x11')](_0xcbf3('0xe'),_0x22797b,_0x148c95);_0x204e04(_0x148c95);});});}