61d258a0245ee4cf9f17c87fc723d91744e16f92
[motion2.git] / server / api / jscriptyQuestionReport / jscriptyQuestionReport.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 _0x1630=['../../mysqldb','../../config/logger','jayson/promise','http','then','info','JscriptyQuestionReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis'];(function(_0xb7b968,_0x323318){var _0x66f76f=function(_0x44044b){while(--_0x44044b){_0xb7b968['push'](_0xb7b968['shift']());}};_0x66f76f(++_0x323318);}(_0x1630,0x73));var _0x0163=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x1630[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0x0163('0x0'));var util=require(_0x0163('0x1'));var moment=require(_0x0163('0x2'));var BPromise=require('bluebird');var rs=require(_0x0163('0x3'));var fs=require('fs');var Redis=require(_0x0163('0x4'));var db=require(_0x0163('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0163('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0163('0x7'));var client=jayson['client'][_0x0163('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5ea554,_0x2111e4,_0x516bec){return new BPromise(function(_0x185070,_0x2c7f7c){return client['request'](_0x5ea554,_0x516bec)[_0x0163('0x9')](function(_0xdda919){logger[_0x0163('0xa')](_0x0163('0xb'),_0x2111e4,'request\x20sent');logger[_0x0163('0xc')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x2111e4,_0x0163('0xd'),JSON[_0x0163('0xe')](_0xdda919));if(_0xdda919[_0x0163('0xf')]){if(_0xdda919[_0x0163('0xf')][_0x0163('0x10')]===0x1f4){logger[_0x0163('0xf')](_0x0163('0xb'),_0x2111e4,_0xdda919[_0x0163('0xf')][_0x0163('0x11')]);return _0x2c7f7c(_0xdda919[_0x0163('0xf')][_0x0163('0x11')]);}logger[_0x0163('0xf')](_0x0163('0xb'),_0x2111e4,_0xdda919[_0x0163('0xf')][_0x0163('0x11')]);return _0x185070(_0xdda919['error'][_0x0163('0x11')]);}else{logger[_0x0163('0xa')](_0x0163('0xb'),_0x2111e4,_0x0163('0xd'));_0x185070(_0xdda919[_0x0163('0x12')][_0x0163('0x11')]);}})[_0x0163('0x13')](function(_0x1d2453){logger[_0x0163('0xf')](_0x0163('0xb'),_0x2111e4,_0x1d2453);_0x2c7f7c(_0x1d2453);});});}