Built motion from commit ab870f9e.|2.5.44
[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 _0x428b=['ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','then','info','WhatsappTransferReport,\x20%s,\x20%s','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment','bluebird'];(function(_0x49c360,_0x122382){var _0x534133=function(_0x8dd389){while(--_0x8dd389){_0x49c360['push'](_0x49c360['shift']());}};_0x534133(++_0x122382);}(_0x428b,0xc5));var _0xb428=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x428b[_0x4d613c];return _0x301fe3;};'use strict';var _=require('lodash');var util=require(_0xb428('0x0'));var moment=require(_0xb428('0x1'));var BPromise=require(_0xb428('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb428('0x3'));var db=require(_0xb428('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb428('0x5'));var config=require(_0xb428('0x6'));var jayson=require(_0xb428('0x7'));var client=jayson['client'][_0xb428('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x115262,_0x2e0063,_0x4da69f){return new BPromise(function(_0x419c88,_0x20d828){return client['request'](_0x115262,_0x4da69f)[_0xb428('0x9')](function(_0x5ba019){logger[_0xb428('0xa')](_0xb428('0xb'),_0x2e0063,'request\x20sent');logger[_0xb428('0xc')](_0xb428('0xd'),_0x2e0063,_0xb428('0xe'),JSON[_0xb428('0xf')](_0x5ba019));if(_0x5ba019[_0xb428('0x10')]){if(_0x5ba019[_0xb428('0x10')][_0xb428('0x11')]===0x1f4){logger[_0xb428('0x10')](_0xb428('0xb'),_0x2e0063,_0x5ba019[_0xb428('0x10')][_0xb428('0x12')]);return _0x20d828(_0x5ba019[_0xb428('0x10')][_0xb428('0x12')]);}logger[_0xb428('0x10')](_0xb428('0xb'),_0x2e0063,_0x5ba019[_0xb428('0x10')]['message']);return _0x419c88(_0x5ba019[_0xb428('0x10')][_0xb428('0x12')]);}else{logger['info'](_0xb428('0xb'),_0x2e0063,_0xb428('0xe'));_0x419c88(_0x5ba019['result'][_0xb428('0x12')]);}})[_0xb428('0x13')](function(_0x43fc5d){logger[_0xb428('0x10')](_0xb428('0xb'),_0x2e0063,_0x43fc5d);_0x20d828(_0x43fc5d);});});}