Built motion from commit 25580385.|2.6.2
[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 _0x9089=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','bluebird','ioredis'];(function(_0x45bf86,_0x75586e){var _0x1f02b7=function(_0x1ea8a3){while(--_0x1ea8a3){_0x45bf86['push'](_0x45bf86['shift']());}};_0x1f02b7(++_0x75586e);}(_0x9089,0x154));var _0x9908=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x9089[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0x9908('0x0'));var util=require(_0x9908('0x1'));var moment=require(_0x9908('0x2'));var BPromise=require(_0x9908('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9908('0x4'));var db=require(_0x9908('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9908('0x6'))('rpc');var config=require(_0x9908('0x7'));var jayson=require(_0x9908('0x8'));var client=jayson[_0x9908('0x9')][_0x9908('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x353ca4,_0x112929,_0x2c91a5){return new BPromise(function(_0x43984e,_0x2ab98d){return client[_0x9908('0xb')](_0x353ca4,_0x2c91a5)[_0x9908('0xc')](function(_0x3ea21e){logger['info'](_0x9908('0xd'),_0x112929,_0x9908('0xe'));logger[_0x9908('0xf')](_0x9908('0x10'),_0x112929,_0x9908('0xe'),JSON[_0x9908('0x11')](_0x3ea21e));if(_0x3ea21e[_0x9908('0x12')]){if(_0x3ea21e[_0x9908('0x12')][_0x9908('0x13')]===0x1f4){logger['error'](_0x9908('0xd'),_0x112929,_0x3ea21e[_0x9908('0x12')][_0x9908('0x14')]);return _0x2ab98d(_0x3ea21e[_0x9908('0x12')][_0x9908('0x14')]);}logger[_0x9908('0x12')](_0x9908('0xd'),_0x112929,_0x3ea21e[_0x9908('0x12')]['message']);return _0x43984e(_0x3ea21e['error'][_0x9908('0x14')]);}else{logger[_0x9908('0x15')]('WhatsappTransferReport,\x20%s,\x20%s',_0x112929,_0x9908('0xe'));_0x43984e(_0x3ea21e[_0x9908('0x16')][_0x9908('0x14')]);}})['catch'](function(_0x4ef82d){logger['error'](_0x9908('0xd'),_0x112929,_0x4ef82d);_0x2ab98d(_0x4ef82d);});});}