Built motion from commit (unavailable).|2.3.4
[motion2.git] / server / api / integrationReport / integrationReport.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 _0x04ac=['request','then','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http'];(function(_0x5b201f,_0x20c0e5){var _0x476fe2=function(_0x1b27a1){while(--_0x1b27a1){_0x5b201f['push'](_0x5b201f['shift']());}};_0x476fe2(++_0x20c0e5);}(_0x04ac,0xdc));var _0xc04a=function(_0x1aa429,_0x4869b6){_0x1aa429=_0x1aa429-0x0;var _0xc24246=_0x04ac[_0x1aa429];return _0xc24246;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc04a('0x0'));var BPromise=require('bluebird');var rs=require(_0xc04a('0x1'));var fs=require('fs');var Redis=require(_0xc04a('0x2'));var db=require(_0xc04a('0x3'))['db'];var utils=require(_0xc04a('0x4'));var logger=require('../../config/logger')(_0xc04a('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc04a('0x6')][_0xc04a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xf912ce,_0x259d47,_0x3c8721){return new BPromise(function(_0x40dc98,_0x7fc636){return client[_0xc04a('0x8')](_0xf912ce,_0x3c8721)[_0xc04a('0x9')](function(_0x2c21bd){logger['info'](_0xc04a('0xa'),_0x259d47,_0xc04a('0xb'));logger[_0xc04a('0xc')](_0xc04a('0xd'),_0x259d47,_0xc04a('0xb'),JSON['stringify'](_0x2c21bd));if(_0x2c21bd['error']){if(_0x2c21bd[_0xc04a('0xe')]['code']===0x1f4){logger[_0xc04a('0xe')](_0xc04a('0xa'),_0x259d47,_0x2c21bd[_0xc04a('0xe')][_0xc04a('0xf')]);return _0x7fc636(_0x2c21bd[_0xc04a('0xe')][_0xc04a('0xf')]);}logger[_0xc04a('0xe')](_0xc04a('0xa'),_0x259d47,_0x2c21bd[_0xc04a('0xe')][_0xc04a('0xf')]);return _0x40dc98(_0x2c21bd[_0xc04a('0xe')]['message']);}else{logger[_0xc04a('0x10')](_0xc04a('0xa'),_0x259d47,_0xc04a('0xb'));_0x40dc98(_0x2c21bd[_0xc04a('0x11')][_0xc04a('0xf')]);}})[_0xc04a('0x12')](function(_0x30ae43){logger['error']('IntegrationReport,\x20%s,\x20%s',_0x259d47,_0x30ae43);_0x7fc636(_0x30ae43);});});}