Built motion from commit d5e4af8c.|2.6.23
[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 _0x07e8=['jayson/promise','client','then','WhatsappTransferReport,\x20%s,\x20%s','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x29cb61,_0x494484){var _0x21d3e0=function(_0x3e0ac4){while(--_0x3e0ac4){_0x29cb61['push'](_0x29cb61['shift']());}};_0x21d3e0(++_0x494484);}(_0x07e8,0xa0));var _0x807e=function(_0x57f59d,_0x493f90){_0x57f59d=_0x57f59d-0x0;var _0x11c40d=_0x07e8[_0x57f59d];return _0x11c40d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x807e('0x0'));var BPromise=require(_0x807e('0x1'));var rs=require(_0x807e('0x2'));var fs=require('fs');var Redis=require(_0x807e('0x3'));var db=require(_0x807e('0x4'))['db'];var utils=require(_0x807e('0x5'));var logger=require(_0x807e('0x6'))(_0x807e('0x7'));var config=require('../../config/environment');var jayson=require(_0x807e('0x8'));var client=jayson[_0x807e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d6e43,_0x4db50b,_0x45d205){return new BPromise(function(_0x5bba6f,_0x3769fc){return client['request'](_0x3d6e43,_0x45d205)[_0x807e('0xa')](function(_0x153b12){logger['info'](_0x807e('0xb'),_0x4db50b,'request\x20sent');logger[_0x807e('0xc')](_0x807e('0xd'),_0x4db50b,_0x807e('0xe'),JSON[_0x807e('0xf')](_0x153b12));if(_0x153b12[_0x807e('0x10')]){if(_0x153b12['error'][_0x807e('0x11')]===0x1f4){logger['error'](_0x807e('0xb'),_0x4db50b,_0x153b12['error'][_0x807e('0x12')]);return _0x3769fc(_0x153b12[_0x807e('0x10')][_0x807e('0x12')]);}logger[_0x807e('0x10')](_0x807e('0xb'),_0x4db50b,_0x153b12[_0x807e('0x10')][_0x807e('0x12')]);return _0x5bba6f(_0x153b12[_0x807e('0x10')][_0x807e('0x12')]);}else{logger[_0x807e('0x13')](_0x807e('0xb'),_0x4db50b,'request\x20sent');_0x5bba6f(_0x153b12['result']['message']);}})[_0x807e('0x14')](function(_0x14606a){logger[_0x807e('0x10')](_0x807e('0xb'),_0x4db50b,_0x14606a);_0x3769fc(_0x14606a);});});}