f54e37ea97ed4ca0912cbc3b85d9d67095c40deb
[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 _0xcc4c=['util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash'];(function(_0x5a11d2,_0x55e3cc){var _0x61a965=function(_0x17cf73){while(--_0x17cf73){_0x5a11d2['push'](_0x5a11d2['shift']());}};_0x61a965(++_0x55e3cc);}(_0xcc4c,0x149));var _0xccc4=function(_0x1989ab,_0x30de54){_0x1989ab=_0x1989ab-0x0;var _0x1240f1=_0xcc4c[_0x1989ab];return _0x1240f1;};'use strict';var _=require(_0xccc4('0x0'));var util=require(_0xccc4('0x1'));var moment=require(_0xccc4('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xccc4('0x3'));var db=require(_0xccc4('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xccc4('0x5'))(_0xccc4('0x6'));var config=require(_0xccc4('0x7'));var jayson=require(_0xccc4('0x8'));var client=jayson[_0xccc4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x388da8,_0x2b3e76,_0x280644){return new BPromise(function(_0x65a25f,_0xd279f8){return client[_0xccc4('0xa')](_0x388da8,_0x280644)[_0xccc4('0xb')](function(_0x365a85){logger[_0xccc4('0xc')](_0xccc4('0xd'),_0x2b3e76,'request\x20sent');logger[_0xccc4('0xe')](_0xccc4('0xf'),_0x2b3e76,_0xccc4('0x10'),JSON['stringify'](_0x365a85));if(_0x365a85[_0xccc4('0x11')]){if(_0x365a85['error'][_0xccc4('0x12')]===0x1f4){logger[_0xccc4('0x11')]('WhatsappTransferReport,\x20%s,\x20%s',_0x2b3e76,_0x365a85['error'][_0xccc4('0x13')]);return _0xd279f8(_0x365a85[_0xccc4('0x11')][_0xccc4('0x13')]);}logger[_0xccc4('0x11')](_0xccc4('0xd'),_0x2b3e76,_0x365a85[_0xccc4('0x11')][_0xccc4('0x13')]);return _0x65a25f(_0x365a85[_0xccc4('0x11')]['message']);}else{logger[_0xccc4('0xc')]('WhatsappTransferReport,\x20%s,\x20%s',_0x2b3e76,'request\x20sent');_0x65a25f(_0x365a85[_0xccc4('0x14')][_0xccc4('0x13')]);}})[_0xccc4('0x15')](function(_0x366772){logger[_0xccc4('0x11')](_0xccc4('0xd'),_0x2b3e76,_0x366772);_0xd279f8(_0x366772);});});}