c362a185e293a44d4141f666c2df2d49d0334e7d
[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 _0x7842=['randomstring','../../mysqldb','../../config/environment','jayson/promise','http','then','info','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','JscriptyQuestionReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird'];(function(_0x35c33d,_0x46defa){var _0x5139b3=function(_0x427391){while(--_0x427391){_0x35c33d['push'](_0x35c33d['shift']());}};_0x5139b3(++_0x46defa);}(_0x7842,0x1d1));var _0x2784=function(_0x2423d7,_0xe6ec57){_0x2423d7=_0x2423d7-0x0;var _0x151d17=_0x7842[_0x2423d7];return _0x151d17;};'use strict';var _=require(_0x2784('0x0'));var util=require('util');var moment=require(_0x2784('0x1'));var BPromise=require(_0x2784('0x2'));var rs=require(_0x2784('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2784('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x2784('0x5'));var jayson=require(_0x2784('0x6'));var client=jayson['client'][_0x2784('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1ffa7e,_0x42cdd7,_0x2d2d03){return new BPromise(function(_0x3cd41f,_0x302097){return client['request'](_0x1ffa7e,_0x2d2d03)[_0x2784('0x8')](function(_0x477b16){logger[_0x2784('0x9')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x42cdd7,_0x2784('0xa'));logger['debug'](_0x2784('0xb'),_0x42cdd7,_0x2784('0xa'),JSON[_0x2784('0xc')](_0x477b16));if(_0x477b16[_0x2784('0xd')]){if(_0x477b16[_0x2784('0xd')]['code']===0x1f4){logger[_0x2784('0xd')](_0x2784('0xe'),_0x42cdd7,_0x477b16[_0x2784('0xd')]['message']);return _0x302097(_0x477b16[_0x2784('0xd')]['message']);}logger[_0x2784('0xd')](_0x2784('0xe'),_0x42cdd7,_0x477b16['error'][_0x2784('0xf')]);return _0x3cd41f(_0x477b16[_0x2784('0xd')][_0x2784('0xf')]);}else{logger[_0x2784('0x9')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x42cdd7,_0x2784('0xa'));_0x3cd41f(_0x477b16[_0x2784('0x10')][_0x2784('0xf')]);}})[_0x2784('0x11')](function(_0x25f65d){logger[_0x2784('0xd')](_0x2784('0xe'),_0x42cdd7,_0x25f65d);_0x302097(_0x25f65d);});});}