7a3beaf66ccb5c5252db30a063db82f15f1e40f8
[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 _0x5fd1=['result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','WhatsappTransferReport,\x20%s,\x20%s','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0x5fd1,0x1e5));var _0x15fd=function(_0x4da7db,_0x365411){_0x4da7db=_0x4da7db-0x0;var _0x54f53d=_0x5fd1[_0x4da7db];return _0x54f53d;};'use strict';var _=require('lodash');var util=require(_0x15fd('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x15fd('0x1'));var fs=require('fs');var Redis=require(_0x15fd('0x2'));var db=require(_0x15fd('0x3'))['db'];var utils=require(_0x15fd('0x4'));var logger=require(_0x15fd('0x5'))(_0x15fd('0x6'));var config=require(_0x15fd('0x7'));var jayson=require(_0x15fd('0x8'));var client=jayson['client'][_0x15fd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x73a3b0,_0xdc8bde,_0x42163e){return new BPromise(function(_0x38b540,_0x506176){return client[_0x15fd('0xa')](_0x73a3b0,_0x42163e)['then'](function(_0x3a5c17){logger[_0x15fd('0xb')](_0x15fd('0xc'),_0xdc8bde,'request\x20sent');logger[_0x15fd('0xd')](_0x15fd('0xe'),_0xdc8bde,_0x15fd('0xf'),JSON[_0x15fd('0x10')](_0x3a5c17));if(_0x3a5c17['error']){if(_0x3a5c17[_0x15fd('0x11')]['code']===0x1f4){logger[_0x15fd('0x11')](_0x15fd('0xc'),_0xdc8bde,_0x3a5c17[_0x15fd('0x11')][_0x15fd('0x12')]);return _0x506176(_0x3a5c17['error'][_0x15fd('0x12')]);}logger[_0x15fd('0x11')]('WhatsappTransferReport,\x20%s,\x20%s',_0xdc8bde,_0x3a5c17[_0x15fd('0x11')][_0x15fd('0x12')]);return _0x38b540(_0x3a5c17['error'][_0x15fd('0x12')]);}else{logger[_0x15fd('0xb')](_0x15fd('0xc'),_0xdc8bde,_0x15fd('0xf'));_0x38b540(_0x3a5c17[_0x15fd('0x13')][_0x15fd('0x12')]);}})[_0x15fd('0x14')](function(_0x2dd3b1){logger['error'](_0x15fd('0xc'),_0xdc8bde,_0x2dd3b1);_0x506176(_0x2dd3b1);});});}