85d0c93477528e87534c31a494e38a8251eb0281
[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 _0xdfc5=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x2a371a,_0x2f5ad0){var _0x40ef68=function(_0x25d051){while(--_0x25d051){_0x2a371a['push'](_0x2a371a['shift']());}};_0x40ef68(++_0x2f5ad0);}(_0xdfc5,0xa1));var _0x5dfc=function(_0x3ecd74,_0x5a29dc){_0x3ecd74=_0x3ecd74-0x0;var _0x3c71e3=_0xdfc5[_0x3ecd74];return _0x3c71e3;};'use strict';var _=require(_0x5dfc('0x0'));var util=require(_0x5dfc('0x1'));var moment=require(_0x5dfc('0x2'));var BPromise=require(_0x5dfc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5dfc('0x4'));var db=require(_0x5dfc('0x5'))['db'];var utils=require(_0x5dfc('0x6'));var logger=require('../../config/logger')(_0x5dfc('0x7'));var config=require('../../config/environment');var jayson=require(_0x5dfc('0x8'));var client=jayson[_0x5dfc('0x9')][_0x5dfc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3bfa66,_0x403433,_0x28f9bc){return new BPromise(function(_0x323d69,_0x12c0b7){return client[_0x5dfc('0xb')](_0x3bfa66,_0x28f9bc)[_0x5dfc('0xc')](function(_0x1ad7b4){logger[_0x5dfc('0xd')](_0x5dfc('0xe'),_0x403433,_0x5dfc('0xf'));logger[_0x5dfc('0x10')](_0x5dfc('0x11'),_0x403433,_0x5dfc('0xf'),JSON[_0x5dfc('0x12')](_0x1ad7b4));if(_0x1ad7b4[_0x5dfc('0x13')]){if(_0x1ad7b4['error']['code']===0x1f4){logger[_0x5dfc('0x13')]('WhatsappTransferReport,\x20%s,\x20%s',_0x403433,_0x1ad7b4['error'][_0x5dfc('0x14')]);return _0x12c0b7(_0x1ad7b4[_0x5dfc('0x13')][_0x5dfc('0x14')]);}logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x403433,_0x1ad7b4[_0x5dfc('0x13')][_0x5dfc('0x14')]);return _0x323d69(_0x1ad7b4[_0x5dfc('0x13')][_0x5dfc('0x14')]);}else{logger[_0x5dfc('0xd')](_0x5dfc('0xe'),_0x403433,_0x5dfc('0xf'));_0x323d69(_0x1ad7b4[_0x5dfc('0x15')][_0x5dfc('0x14')]);}})[_0x5dfc('0x16')](function(_0x1b893e){logger[_0x5dfc('0x13')]('WhatsappTransferReport,\x20%s,\x20%s',_0x403433,_0x1b893e);_0x12c0b7(_0x1b893e);});});}