22228abcac3ec37fbacda2ce3fc902abf266e98c
[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 _0x1c23=['request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','WhatsappTransferReport,\x20%s,\x20%s','WhatsappTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1c23,0x1c0));var _0x31c2=function(_0x351c49,_0x4740bb){_0x351c49=_0x351c49-0x0;var _0x4e1a5f=_0x1c23[_0x351c49];return _0x4e1a5f;};'use strict';var _=require(_0x31c2('0x0'));var util=require('util');var moment=require(_0x31c2('0x1'));var BPromise=require(_0x31c2('0x2'));var rs=require(_0x31c2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x31c2('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x31c2('0x5'))(_0x31c2('0x6'));var config=require(_0x31c2('0x7'));var jayson=require(_0x31c2('0x8'));var client=jayson['client'][_0x31c2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x496b14,_0x2330c0,_0x340249){return new BPromise(function(_0x21bb22,_0x27d5ac){return client['request'](_0x496b14,_0x340249)[_0x31c2('0xa')](function(_0x132487){logger[_0x31c2('0xb')](_0x31c2('0xc'),_0x2330c0,'request\x20sent');logger['debug'](_0x31c2('0xd'),_0x2330c0,_0x31c2('0xe'),JSON[_0x31c2('0xf')](_0x132487));if(_0x132487[_0x31c2('0x10')]){if(_0x132487['error'][_0x31c2('0x11')]===0x1f4){logger[_0x31c2('0x10')](_0x31c2('0xc'),_0x2330c0,_0x132487[_0x31c2('0x10')][_0x31c2('0x12')]);return _0x27d5ac(_0x132487['error'][_0x31c2('0x12')]);}logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x2330c0,_0x132487[_0x31c2('0x10')]['message']);return _0x21bb22(_0x132487[_0x31c2('0x10')][_0x31c2('0x12')]);}else{logger[_0x31c2('0xb')]('WhatsappTransferReport,\x20%s,\x20%s',_0x2330c0,_0x31c2('0xe'));_0x21bb22(_0x132487[_0x31c2('0x13')][_0x31c2('0x12')]);}})[_0x31c2('0x14')](function(_0x98834d){logger[_0x31c2('0x10')](_0x31c2('0xc'),_0x2330c0,_0x98834d);_0x27d5ac(_0x98834d);});});}