Built motion from commit 497d3d92.|2.5.43
[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 _0x6622=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x506d83,_0x1899e9){var _0x335e8b=function(_0x4a7044){while(--_0x4a7044){_0x506d83['push'](_0x506d83['shift']());}};_0x335e8b(++_0x1899e9);}(_0x6622,0x90));var _0x2662=function(_0x49a57c,_0x2eb02c){_0x49a57c=_0x49a57c-0x0;var _0x4e0316=_0x6622[_0x49a57c];return _0x4e0316;};'use strict';var _=require('lodash');var util=require(_0x2662('0x0'));var moment=require(_0x2662('0x1'));var BPromise=require(_0x2662('0x2'));var rs=require(_0x2662('0x3'));var fs=require('fs');var Redis=require(_0x2662('0x4'));var db=require(_0x2662('0x5'))['db'];var utils=require(_0x2662('0x6'));var logger=require(_0x2662('0x7'))(_0x2662('0x8'));var config=require(_0x2662('0x9'));var jayson=require(_0x2662('0xa'));var client=jayson[_0x2662('0xb')][_0x2662('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2e5362,_0x50766a,_0x5d7122){return new BPromise(function(_0x574530,_0x4e202f){return client['request'](_0x2e5362,_0x5d7122)[_0x2662('0xd')](function(_0x461ea0){logger[_0x2662('0xe')](_0x2662('0xf'),_0x50766a,_0x2662('0x10'));logger[_0x2662('0x11')](_0x2662('0x12'),_0x50766a,_0x2662('0x10'),JSON[_0x2662('0x13')](_0x461ea0));if(_0x461ea0['error']){if(_0x461ea0[_0x2662('0x14')][_0x2662('0x15')]===0x1f4){logger[_0x2662('0x14')](_0x2662('0xf'),_0x50766a,_0x461ea0[_0x2662('0x14')]['message']);return _0x4e202f(_0x461ea0['error'][_0x2662('0x16')]);}logger[_0x2662('0x14')](_0x2662('0xf'),_0x50766a,_0x461ea0[_0x2662('0x14')][_0x2662('0x16')]);return _0x574530(_0x461ea0[_0x2662('0x14')][_0x2662('0x16')]);}else{logger[_0x2662('0xe')](_0x2662('0xf'),_0x50766a,_0x2662('0x10'));_0x574530(_0x461ea0[_0x2662('0x17')]['message']);}})[_0x2662('0x18')](function(_0xad95cc){logger[_0x2662('0x14')]('WhatsappTransferReport,\x20%s,\x20%s',_0x50766a,_0xad95cc);_0x4e202f(_0xad95cc);});});}