Built motion from commit 775e2a94.|2.6.3
[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 _0x78a2=['../../config/logger','rpc','../../config/environment','client','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','../../config/utils'];(function(_0x2f2e3f,_0x902203){var _0x2bb971=function(_0x584cb9){while(--_0x584cb9){_0x2f2e3f['push'](_0x2f2e3f['shift']());}};_0x2bb971(++_0x902203);}(_0x78a2,0x8e));var _0x278a=function(_0x3c789c,_0x3515b1){_0x3c789c=_0x3c789c-0x0;var _0x3be991=_0x78a2[_0x3c789c];return _0x3be991;};'use strict';var _=require(_0x278a('0x0'));var util=require(_0x278a('0x1'));var moment=require(_0x278a('0x2'));var BPromise=require(_0x278a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x278a('0x4'));var logger=require(_0x278a('0x5'))(_0x278a('0x6'));var config=require(_0x278a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x278a('0x8')][_0x278a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x21512e,_0x2848d1,_0x2d246b){return new BPromise(function(_0x266d38,_0x293fc9){return client[_0x278a('0xa')](_0x21512e,_0x2d246b)[_0x278a('0xb')](function(_0x5b4eb1){logger[_0x278a('0xc')](_0x278a('0xd'),_0x2848d1,_0x278a('0xe'));logger[_0x278a('0xf')](_0x278a('0x10'),_0x2848d1,'request\x20sent',JSON['stringify'](_0x5b4eb1));if(_0x5b4eb1['error']){if(_0x5b4eb1[_0x278a('0x11')][_0x278a('0x12')]===0x1f4){logger[_0x278a('0x11')](_0x278a('0xd'),_0x2848d1,_0x5b4eb1['error'][_0x278a('0x13')]);return _0x293fc9(_0x5b4eb1[_0x278a('0x11')]['message']);}logger[_0x278a('0x11')](_0x278a('0xd'),_0x2848d1,_0x5b4eb1[_0x278a('0x11')]['message']);return _0x266d38(_0x5b4eb1[_0x278a('0x11')][_0x278a('0x13')]);}else{logger[_0x278a('0xc')](_0x278a('0xd'),_0x2848d1,'request\x20sent');_0x266d38(_0x5b4eb1[_0x278a('0x14')]['message']);}})['catch'](function(_0x396a65){logger[_0x278a('0x11')](_0x278a('0xd'),_0x2848d1,_0x396a65);_0x293fc9(_0x396a65);});});}