Built motion from commit b5996064.|2.6.21
[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 _0x1de8=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','WhatsappTransferReport,\x20%s,\x20%s','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x53317c,_0x320387){var _0x6b214f=function(_0x2e32ac){while(--_0x2e32ac){_0x53317c['push'](_0x53317c['shift']());}};_0x6b214f(++_0x320387);}(_0x1de8,0x102));var _0x81de=function(_0x39e164,_0x2cb93b){_0x39e164=_0x39e164-0x0;var _0x13fa6b=_0x1de8[_0x39e164];return _0x13fa6b;};'use strict';var _=require(_0x81de('0x0'));var util=require(_0x81de('0x1'));var moment=require(_0x81de('0x2'));var BPromise=require(_0x81de('0x3'));var rs=require(_0x81de('0x4'));var fs=require('fs');var Redis=require(_0x81de('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x81de('0x6'));var logger=require(_0x81de('0x7'))(_0x81de('0x8'));var config=require(_0x81de('0x9'));var jayson=require(_0x81de('0xa'));var client=jayson[_0x81de('0xb')][_0x81de('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5ea2c7,_0x530c2c,_0x319679){return new BPromise(function(_0x2b3098,_0xc9218){return client['request'](_0x5ea2c7,_0x319679)[_0x81de('0xd')](function(_0x523985){logger[_0x81de('0xe')](_0x81de('0xf'),_0x530c2c,'request\x20sent');logger[_0x81de('0x10')](_0x81de('0x11'),_0x530c2c,_0x81de('0x12'),JSON[_0x81de('0x13')](_0x523985));if(_0x523985[_0x81de('0x14')]){if(_0x523985[_0x81de('0x14')][_0x81de('0x15')]===0x1f4){logger[_0x81de('0x14')](_0x81de('0xf'),_0x530c2c,_0x523985[_0x81de('0x14')][_0x81de('0x16')]);return _0xc9218(_0x523985['error'][_0x81de('0x16')]);}logger['error'](_0x81de('0xf'),_0x530c2c,_0x523985[_0x81de('0x14')][_0x81de('0x16')]);return _0x2b3098(_0x523985['error'][_0x81de('0x16')]);}else{logger[_0x81de('0xe')](_0x81de('0xf'),_0x530c2c,'request\x20sent');_0x2b3098(_0x523985[_0x81de('0x17')][_0x81de('0x16')]);}})['catch'](function(_0xeeb4b9){logger[_0x81de('0x14')](_0x81de('0xf'),_0x530c2c,_0xeeb4b9);_0xc9218(_0xeeb4b9);});});}