15618045d6c23bab5d104dfe7b592a96fde9588f
[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 _0x448b=['code','message','result','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4a4922,_0x82cb8f){var _0x55a8c6=function(_0x59712e){while(--_0x59712e){_0x4a4922['push'](_0x4a4922['shift']());}};_0x55a8c6(++_0x82cb8f);}(_0x448b,0x11b));var _0xb448=function(_0x1c4b39,_0x3e911a){_0x1c4b39=_0x1c4b39-0x0;var _0xc54951=_0x448b[_0x1c4b39];return _0xc54951;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb448('0x0'));var BPromise=require(_0xb448('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb448('0x2'));var db=require(_0xb448('0x3'))['db'];var utils=require(_0xb448('0x4'));var logger=require(_0xb448('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb448('0x6'));var client=jayson[_0xb448('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x390a46,_0x352d3e,_0x211d87){return new BPromise(function(_0x367632,_0x432368){return client[_0xb448('0x8')](_0x390a46,_0x211d87)[_0xb448('0x9')](function(_0x4418f9){logger[_0xb448('0xa')](_0xb448('0xb'),_0x352d3e,_0xb448('0xc'));logger[_0xb448('0xd')](_0xb448('0xe'),_0x352d3e,'request\x20sent',JSON[_0xb448('0xf')](_0x4418f9));if(_0x4418f9['error']){if(_0x4418f9[_0xb448('0x10')][_0xb448('0x11')]===0x1f4){logger[_0xb448('0x10')](_0xb448('0xb'),_0x352d3e,_0x4418f9[_0xb448('0x10')][_0xb448('0x12')]);return _0x432368(_0x4418f9[_0xb448('0x10')][_0xb448('0x12')]);}logger[_0xb448('0x10')](_0xb448('0xb'),_0x352d3e,_0x4418f9[_0xb448('0x10')][_0xb448('0x12')]);return _0x367632(_0x4418f9[_0xb448('0x10')][_0xb448('0x12')]);}else{logger[_0xb448('0xa')](_0xb448('0xb'),_0x352d3e,_0xb448('0xc'));_0x367632(_0x4418f9[_0xb448('0x13')]['message']);}})['catch'](function(_0x311a2d){logger[_0xb448('0x10')](_0xb448('0xb'),_0x352d3e,_0x311a2d);_0x432368(_0x311a2d);});});}