53c50c2e29016c1756fd1abe9498221e8644f768
[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 _0xecd1=['request','then','info','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','WhatsappTransferReport,\x20%s,\x20%s','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x14b1cb,_0x23b33c){var _0xfac4aa=function(_0x2fe447){while(--_0x2fe447){_0x14b1cb['push'](_0x14b1cb['shift']());}};_0xfac4aa(++_0x23b33c);}(_0xecd1,0xe8));var _0x1ecd=function(_0x9765da,_0x21ad60){_0x9765da=_0x9765da-0x0;var _0x39b505=_0xecd1[_0x9765da];return _0x39b505;};'use strict';var _=require(_0x1ecd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1ecd('0x1'));var rs=require(_0x1ecd('0x2'));var fs=require('fs');var Redis=require(_0x1ecd('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1ecd('0x4'));var logger=require(_0x1ecd('0x5'))(_0x1ecd('0x6'));var config=require(_0x1ecd('0x7'));var jayson=require(_0x1ecd('0x8'));var client=jayson[_0x1ecd('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x238f37,_0x367955,_0x50b99f){return new BPromise(function(_0x2f8a53,_0x530ff6){return client[_0x1ecd('0xa')](_0x238f37,_0x50b99f)[_0x1ecd('0xb')](function(_0x133483){logger[_0x1ecd('0xc')]('WhatsappTransferReport,\x20%s,\x20%s',_0x367955,_0x1ecd('0xd'));logger[_0x1ecd('0xe')](_0x1ecd('0xf'),_0x367955,'request\x20sent',JSON[_0x1ecd('0x10')](_0x133483));if(_0x133483[_0x1ecd('0x11')]){if(_0x133483[_0x1ecd('0x11')][_0x1ecd('0x12')]===0x1f4){logger[_0x1ecd('0x11')]('WhatsappTransferReport,\x20%s,\x20%s',_0x367955,_0x133483[_0x1ecd('0x11')][_0x1ecd('0x13')]);return _0x530ff6(_0x133483[_0x1ecd('0x11')][_0x1ecd('0x13')]);}logger[_0x1ecd('0x11')](_0x1ecd('0x14'),_0x367955,_0x133483[_0x1ecd('0x11')]['message']);return _0x2f8a53(_0x133483[_0x1ecd('0x11')][_0x1ecd('0x13')]);}else{logger['info'](_0x1ecd('0x14'),_0x367955,_0x1ecd('0xd'));_0x2f8a53(_0x133483['result'][_0x1ecd('0x13')]);}})[_0x1ecd('0x15')](function(_0x55a77a){logger[_0x1ecd('0x11')]('WhatsappTransferReport,\x20%s,\x20%s',_0x367955,_0x55a77a);_0x530ff6(_0x55a77a);});});}