Built motion from commit da617fac.|2.6.6
[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 _0x78bc=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','WhatsappTransferReport,\x20%s,\x20%s','result','catch','moment','bluebird'];(function(_0x539840,_0x55c212){var _0x245439=function(_0x1bc4da){while(--_0x1bc4da){_0x539840['push'](_0x539840['shift']());}};_0x245439(++_0x55c212);}(_0x78bc,0xee));var _0xc78b=function(_0x79ea1e,_0x21c274){_0x79ea1e=_0x79ea1e-0x0;var _0x1845e5=_0x78bc[_0x79ea1e];return _0x1845e5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc78b('0x0'));var BPromise=require(_0xc78b('0x1'));var rs=require(_0xc78b('0x2'));var fs=require('fs');var Redis=require(_0xc78b('0x3'));var db=require(_0xc78b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc78b('0x5'))(_0xc78b('0x6'));var config=require(_0xc78b('0x7'));var jayson=require(_0xc78b('0x8'));var client=jayson[_0xc78b('0x9')][_0xc78b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x256da8,_0x900c46,_0x8d1c04){return new BPromise(function(_0x9b9d62,_0x48ed46){return client[_0xc78b('0xb')](_0x256da8,_0x8d1c04)[_0xc78b('0xc')](function(_0x43967e){logger[_0xc78b('0xd')]('WhatsappTransferReport,\x20%s,\x20%s',_0x900c46,_0xc78b('0xe'));logger[_0xc78b('0xf')](_0xc78b('0x10'),_0x900c46,_0xc78b('0xe'),JSON[_0xc78b('0x11')](_0x43967e));if(_0x43967e[_0xc78b('0x12')]){if(_0x43967e['error'][_0xc78b('0x13')]===0x1f4){logger[_0xc78b('0x12')]('WhatsappTransferReport,\x20%s,\x20%s',_0x900c46,_0x43967e[_0xc78b('0x12')][_0xc78b('0x14')]);return _0x48ed46(_0x43967e[_0xc78b('0x12')][_0xc78b('0x14')]);}logger[_0xc78b('0x12')](_0xc78b('0x15'),_0x900c46,_0x43967e[_0xc78b('0x12')][_0xc78b('0x14')]);return _0x9b9d62(_0x43967e[_0xc78b('0x12')][_0xc78b('0x14')]);}else{logger[_0xc78b('0xd')](_0xc78b('0x15'),_0x900c46,_0xc78b('0xe'));_0x9b9d62(_0x43967e[_0xc78b('0x16')]['message']);}})[_0xc78b('0x17')](function(_0x474608){logger[_0xc78b('0x12')]('WhatsappTransferReport,\x20%s,\x20%s',_0x900c46,_0x474608);_0x48ed46(_0x474608);});});}