3f47542854cc348fc04e98fc7ac3ecbb13870368
[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 _0x6c13=['../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','WhatsappTransferReport,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3740fe,_0x6c543c){var _0x55492b=function(_0x1f851f){while(--_0x1f851f){_0x3740fe['push'](_0x3740fe['shift']());}};_0x55492b(++_0x6c543c);}(_0x6c13,0x10b));var _0x36c1=function(_0x31f8a0,_0x1e3391){_0x31f8a0=_0x31f8a0-0x0;var _0x319328=_0x6c13[_0x31f8a0];return _0x319328;};'use strict';var _=require('lodash');var util=require(_0x36c1('0x0'));var moment=require(_0x36c1('0x1'));var BPromise=require(_0x36c1('0x2'));var rs=require(_0x36c1('0x3'));var fs=require('fs');var Redis=require(_0x36c1('0x4'));var db=require(_0x36c1('0x5'))['db'];var utils=require(_0x36c1('0x6'));var logger=require('../../config/logger')(_0x36c1('0x7'));var config=require(_0x36c1('0x8'));var jayson=require(_0x36c1('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xeb4ab8,_0x132645,_0x1da6c5){return new BPromise(function(_0x542d0b,_0x147b8e){return client[_0x36c1('0xa')](_0xeb4ab8,_0x1da6c5)[_0x36c1('0xb')](function(_0x7375a3){logger[_0x36c1('0xc')]('WhatsappTransferReport,\x20%s,\x20%s',_0x132645,_0x36c1('0xd'));logger['debug'](_0x36c1('0xe'),_0x132645,_0x36c1('0xd'),JSON[_0x36c1('0xf')](_0x7375a3));if(_0x7375a3[_0x36c1('0x10')]){if(_0x7375a3['error']['code']===0x1f4){logger[_0x36c1('0x10')](_0x36c1('0x11'),_0x132645,_0x7375a3['error']['message']);return _0x147b8e(_0x7375a3['error'][_0x36c1('0x12')]);}logger[_0x36c1('0x10')](_0x36c1('0x11'),_0x132645,_0x7375a3['error']['message']);return _0x542d0b(_0x7375a3['error'][_0x36c1('0x12')]);}else{logger[_0x36c1('0xc')](_0x36c1('0x11'),_0x132645,_0x36c1('0xd'));_0x542d0b(_0x7375a3[_0x36c1('0x13')][_0x36c1('0x12')]);}})[_0x36c1('0x14')](function(_0x5e57e7){logger[_0x36c1('0x10')](_0x36c1('0x11'),_0x132645,_0x5e57e7);_0x147b8e(_0x5e57e7);});});}