Built motion from commit e1760111.|2.6.18
[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 _0x12ed=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash'];(function(_0x3fc4be,_0x35aa1d){var _0x44ccb3=function(_0x477668){while(--_0x477668){_0x3fc4be['push'](_0x3fc4be['shift']());}};_0x44ccb3(++_0x35aa1d);}(_0x12ed,0x1e2));var _0xd12e=function(_0x37fb0f,_0x53df2e){_0x37fb0f=_0x37fb0f-0x0;var _0x5930de=_0x12ed[_0x37fb0f];return _0x5930de;};'use strict';var _=require(_0xd12e('0x0'));var util=require(_0xd12e('0x1'));var moment=require('moment');var BPromise=require(_0xd12e('0x2'));var rs=require(_0xd12e('0x3'));var fs=require('fs');var Redis=require(_0xd12e('0x4'));var db=require(_0xd12e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd12e('0x6'))('rpc');var config=require(_0xd12e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd12e('0x8')][_0xd12e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x249b1f,_0x220d2b,_0x2c4b2c){return new BPromise(function(_0x1b13e1,_0x211c62){return client[_0xd12e('0xa')](_0x249b1f,_0x2c4b2c)[_0xd12e('0xb')](function(_0x48ad9c){logger[_0xd12e('0xc')](_0xd12e('0xd'),_0x220d2b,_0xd12e('0xe'));logger[_0xd12e('0xf')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x220d2b,_0xd12e('0xe'),JSON[_0xd12e('0x10')](_0x48ad9c));if(_0x48ad9c[_0xd12e('0x11')]){if(_0x48ad9c[_0xd12e('0x11')][_0xd12e('0x12')]===0x1f4){logger[_0xd12e('0x11')](_0xd12e('0xd'),_0x220d2b,_0x48ad9c[_0xd12e('0x11')][_0xd12e('0x13')]);return _0x211c62(_0x48ad9c[_0xd12e('0x11')][_0xd12e('0x13')]);}logger['error'](_0xd12e('0xd'),_0x220d2b,_0x48ad9c['error'][_0xd12e('0x13')]);return _0x1b13e1(_0x48ad9c[_0xd12e('0x11')][_0xd12e('0x13')]);}else{logger['info'](_0xd12e('0xd'),_0x220d2b,'request\x20sent');_0x1b13e1(_0x48ad9c[_0xd12e('0x14')][_0xd12e('0x13')]);}})['catch'](function(_0xb84cc8){logger[_0xd12e('0x11')](_0xd12e('0xd'),_0x220d2b,_0xb84cc8);_0x211c62(_0xb84cc8);});});}