Built motion from commit 9efc8423.|2.6.31
[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 _0x15a3=['then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x292716,_0x96d32){var _0x34cb57=function(_0x1d0cde){while(--_0x1d0cde){_0x292716['push'](_0x292716['shift']());}};_0x34cb57(++_0x96d32);}(_0x15a3,0x18c));var _0x315a=function(_0x18f82b,_0x3ea7a0){_0x18f82b=_0x18f82b-0x0;var _0x5d8128=_0x15a3[_0x18f82b];return _0x5d8128;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x315a('0x0'));var BPromise=require(_0x315a('0x1'));var rs=require(_0x315a('0x2'));var fs=require('fs');var Redis=require(_0x315a('0x3'));var db=require(_0x315a('0x4'))['db'];var utils=require(_0x315a('0x5'));var logger=require('../../config/logger')(_0x315a('0x6'));var config=require(_0x315a('0x7'));var jayson=require(_0x315a('0x8'));var client=jayson[_0x315a('0x9')][_0x315a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x193d57,_0x299c50,_0x180434){return new BPromise(function(_0x2679b7,_0x55a60e){return client[_0x315a('0xb')](_0x193d57,_0x180434)[_0x315a('0xc')](function(_0x41b9ff){logger[_0x315a('0xd')](_0x315a('0xe'),_0x299c50,_0x315a('0xf'));logger[_0x315a('0x10')](_0x315a('0x11'),_0x299c50,_0x315a('0xf'),JSON[_0x315a('0x12')](_0x41b9ff));if(_0x41b9ff[_0x315a('0x13')]){if(_0x41b9ff[_0x315a('0x13')][_0x315a('0x14')]===0x1f4){logger[_0x315a('0x13')](_0x315a('0xe'),_0x299c50,_0x41b9ff['error'][_0x315a('0x15')]);return _0x55a60e(_0x41b9ff[_0x315a('0x13')][_0x315a('0x15')]);}logger[_0x315a('0x13')]('WhatsappTransferReport,\x20%s,\x20%s',_0x299c50,_0x41b9ff['error']['message']);return _0x2679b7(_0x41b9ff[_0x315a('0x13')][_0x315a('0x15')]);}else{logger['info'](_0x315a('0xe'),_0x299c50,'request\x20sent');_0x2679b7(_0x41b9ff[_0x315a('0x16')]['message']);}})[_0x315a('0x17')](function(_0x565877){logger[_0x315a('0x13')]('WhatsappTransferReport,\x20%s,\x20%s',_0x299c50,_0x565877);_0x55a60e(_0x565877);});});}