Built motion from commit da617fac.|2.6.6
[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 _0x71bd=['client','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x52bfa5,_0x42cf21){var _0x26f80b=function(_0x73c5b0){while(--_0x73c5b0){_0x52bfa5['push'](_0x52bfa5['shift']());}};_0x26f80b(++_0x42cf21);}(_0x71bd,0x185));var _0xd71b=function(_0x17e284,_0x4f32c6){_0x17e284=_0x17e284-0x0;var _0x51581d=_0x71bd[_0x17e284];return _0x51581d;};'use strict';var _=require(_0xd71b('0x0'));var util=require(_0xd71b('0x1'));var moment=require('moment');var BPromise=require(_0xd71b('0x2'));var rs=require(_0xd71b('0x3'));var fs=require('fs');var Redis=require(_0xd71b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd71b('0x5'));var logger=require(_0xd71b('0x6'))(_0xd71b('0x7'));var config=require(_0xd71b('0x8'));var jayson=require(_0xd71b('0x9'));var client=jayson[_0xd71b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43c095,_0xcbb112,_0x41eb4e){return new BPromise(function(_0x2a8abe,_0x2556cb){return client['request'](_0x43c095,_0x41eb4e)[_0xd71b('0xb')](function(_0x5cf70e){logger[_0xd71b('0xc')](_0xd71b('0xd'),_0xcbb112,_0xd71b('0xe'));logger['debug'](_0xd71b('0xf'),_0xcbb112,_0xd71b('0xe'),JSON[_0xd71b('0x10')](_0x5cf70e));if(_0x5cf70e[_0xd71b('0x11')]){if(_0x5cf70e[_0xd71b('0x11')]['code']===0x1f4){logger[_0xd71b('0x11')](_0xd71b('0xd'),_0xcbb112,_0x5cf70e[_0xd71b('0x11')][_0xd71b('0x12')]);return _0x2556cb(_0x5cf70e[_0xd71b('0x11')]['message']);}logger['error'](_0xd71b('0xd'),_0xcbb112,_0x5cf70e[_0xd71b('0x11')][_0xd71b('0x12')]);return _0x2a8abe(_0x5cf70e['error'][_0xd71b('0x12')]);}else{logger[_0xd71b('0xc')]('WhatsappTransferReport,\x20%s,\x20%s',_0xcbb112,_0xd71b('0xe'));_0x2a8abe(_0x5cf70e[_0xd71b('0x13')][_0xd71b('0x12')]);}})[_0xd71b('0x14')](function(_0x399312){logger['error'](_0xd71b('0xd'),_0xcbb112,_0x399312);_0x2556cb(_0x399312);});});}