Built motion from commit 14588770.|2.5.38
[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 _0xb605=['client','http','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0xb605,0x160));var _0x5b60=function(_0x54ccd7,_0x3bc3ce){_0x54ccd7=_0x54ccd7-0x0;var _0x4e667b=_0xb605[_0x54ccd7];return _0x4e667b;};'use strict';var _=require(_0x5b60('0x0'));var util=require(_0x5b60('0x1'));var moment=require(_0x5b60('0x2'));var BPromise=require(_0x5b60('0x3'));var rs=require(_0x5b60('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5b60('0x5'))('rpc');var config=require(_0x5b60('0x6'));var jayson=require(_0x5b60('0x7'));var client=jayson[_0x5b60('0x8')][_0x5b60('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x586957,_0xe6f08b,_0x11be70){return new BPromise(function(_0x166359,_0x3df59e){return client['request'](_0x586957,_0x11be70)['then'](function(_0x24c92c){logger[_0x5b60('0xa')](_0x5b60('0xb'),_0xe6f08b,_0x5b60('0xc'));logger[_0x5b60('0xd')](_0x5b60('0xe'),_0xe6f08b,_0x5b60('0xc'),JSON['stringify'](_0x24c92c));if(_0x24c92c['error']){if(_0x24c92c['error'][_0x5b60('0xf')]===0x1f4){logger['error'](_0x5b60('0xb'),_0xe6f08b,_0x24c92c[_0x5b60('0x10')]['message']);return _0x3df59e(_0x24c92c['error'][_0x5b60('0x11')]);}logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0xe6f08b,_0x24c92c[_0x5b60('0x10')][_0x5b60('0x11')]);return _0x166359(_0x24c92c[_0x5b60('0x10')][_0x5b60('0x11')]);}else{logger[_0x5b60('0xa')](_0x5b60('0xb'),_0xe6f08b,_0x5b60('0xc'));_0x166359(_0x24c92c[_0x5b60('0x12')][_0x5b60('0x11')]);}})[_0x5b60('0x13')](function(_0x19a4ec){logger[_0x5b60('0x10')](_0x5b60('0xb'),_0xe6f08b,_0x19a4ec);_0x3df59e(_0x19a4ec);});});}