Built motion from commit 19a84241.|2.5.34
[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 _0xf305=['error','code','WhatsappTransferReport,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug'];(function(_0x165fe9,_0x1c8c84){var _0x38aa5b=function(_0x1e886d){while(--_0x1e886d){_0x165fe9['push'](_0x165fe9['shift']());}};_0x38aa5b(++_0x1c8c84);}(_0xf305,0x84));var _0x5f30=function(_0x59f0f7,_0x423bc4){_0x59f0f7=_0x59f0f7-0x0;var _0xf5ef2a=_0xf305[_0x59f0f7];return _0xf5ef2a;};'use strict';var _=require('lodash');var util=require(_0x5f30('0x0'));var moment=require(_0x5f30('0x1'));var BPromise=require('bluebird');var rs=require(_0x5f30('0x2'));var fs=require('fs');var Redis=require(_0x5f30('0x3'));var db=require(_0x5f30('0x4'))['db'];var utils=require(_0x5f30('0x5'));var logger=require(_0x5f30('0x6'))('rpc');var config=require(_0x5f30('0x7'));var jayson=require(_0x5f30('0x8'));var client=jayson[_0x5f30('0x9')][_0x5f30('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5b7515,_0x4e13e0,_0x846463){return new BPromise(function(_0x489003,_0x3adecf){return client['request'](_0x5b7515,_0x846463)[_0x5f30('0xb')](function(_0x3870ee){logger[_0x5f30('0xc')]('WhatsappTransferReport,\x20%s,\x20%s',_0x4e13e0,_0x5f30('0xd'));logger[_0x5f30('0xe')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x4e13e0,_0x5f30('0xd'),JSON['stringify'](_0x3870ee));if(_0x3870ee[_0x5f30('0xf')]){if(_0x3870ee[_0x5f30('0xf')][_0x5f30('0x10')]===0x1f4){logger[_0x5f30('0xf')](_0x5f30('0x11'),_0x4e13e0,_0x3870ee['error']['message']);return _0x3adecf(_0x3870ee[_0x5f30('0xf')][_0x5f30('0x12')]);}logger[_0x5f30('0xf')](_0x5f30('0x11'),_0x4e13e0,_0x3870ee[_0x5f30('0xf')][_0x5f30('0x12')]);return _0x489003(_0x3870ee[_0x5f30('0xf')][_0x5f30('0x12')]);}else{logger['info'](_0x5f30('0x11'),_0x4e13e0,_0x5f30('0xd'));_0x489003(_0x3870ee[_0x5f30('0x13')]['message']);}})[_0x5f30('0x14')](function(_0x3af862){logger[_0x5f30('0xf')](_0x5f30('0x11'),_0x4e13e0,_0x3af862);_0x3adecf(_0x3af862);});});}