1499038406c227f6bdf297f0e3aefa0fc4341928
[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 _0x6bbc=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','WhatsappTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x28f32c,_0x4cc342){var _0x355402=function(_0xdb5032){while(--_0xdb5032){_0x28f32c['push'](_0x28f32c['shift']());}};_0x355402(++_0x4cc342);}(_0x6bbc,0xcc));var _0xc6bb=function(_0x182456,_0x1d9d59){_0x182456=_0x182456-0x0;var _0x433c23=_0x6bbc[_0x182456];return _0x433c23;};'use strict';var _=require(_0xc6bb('0x0'));var util=require(_0xc6bb('0x1'));var moment=require(_0xc6bb('0x2'));var BPromise=require(_0xc6bb('0x3'));var rs=require(_0xc6bb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc6bb('0x5'));var logger=require(_0xc6bb('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc6bb('0x7'));var client=jayson[_0xc6bb('0x8')][_0xc6bb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x61a6fd,_0x4dd655,_0x4df101){return new BPromise(function(_0x2a3c72,_0x514aee){return client[_0xc6bb('0xa')](_0x61a6fd,_0x4df101)[_0xc6bb('0xb')](function(_0x5547d0){logger[_0xc6bb('0xc')](_0xc6bb('0xd'),_0x4dd655,_0xc6bb('0xe'));logger['debug'](_0xc6bb('0xf'),_0x4dd655,_0xc6bb('0xe'),JSON[_0xc6bb('0x10')](_0x5547d0));if(_0x5547d0[_0xc6bb('0x11')]){if(_0x5547d0[_0xc6bb('0x11')][_0xc6bb('0x12')]===0x1f4){logger[_0xc6bb('0x11')](_0xc6bb('0xd'),_0x4dd655,_0x5547d0['error'][_0xc6bb('0x13')]);return _0x514aee(_0x5547d0['error'][_0xc6bb('0x13')]);}logger[_0xc6bb('0x11')](_0xc6bb('0xd'),_0x4dd655,_0x5547d0[_0xc6bb('0x11')][_0xc6bb('0x13')]);return _0x2a3c72(_0x5547d0[_0xc6bb('0x11')][_0xc6bb('0x13')]);}else{logger['info']('WhatsappTransferReport,\x20%s,\x20%s',_0x4dd655,_0xc6bb('0xe'));_0x2a3c72(_0x5547d0[_0xc6bb('0x14')][_0xc6bb('0x13')]);}})[_0xc6bb('0x15')](function(_0x1c370d){logger[_0xc6bb('0x11')](_0xc6bb('0xd'),_0x4dd655,_0x1c370d);_0x514aee(_0x1c370d);});});}