b04e8f74165a77f06e08a94eb51c9b94b407e8ce
[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 _0xdd3f=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','http','request','then','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','info'];(function(_0x33b618,_0x5a2279){var _0x45707e=function(_0x36b9c5){while(--_0x36b9c5){_0x33b618['push'](_0x33b618['shift']());}};_0x45707e(++_0x5a2279);}(_0xdd3f,0x66));var _0xfdd3=function(_0x380eaf,_0x51afb7){_0x380eaf=_0x380eaf-0x0;var _0x58a936=_0xdd3f[_0x380eaf];return _0x58a936;};'use strict';var _=require(_0xfdd3('0x0'));var util=require(_0xfdd3('0x1'));var moment=require('moment');var BPromise=require(_0xfdd3('0x2'));var rs=require(_0xfdd3('0x3'));var fs=require('fs');var Redis=require(_0xfdd3('0x4'));var db=require(_0xfdd3('0x5'))['db'];var utils=require(_0xfdd3('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfdd3('0x7')][_0xfdd3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x40ee9b,_0x663e27,_0x4db3d6){return new BPromise(function(_0x3e1d6d,_0x24f90a){return client[_0xfdd3('0x9')](_0x40ee9b,_0x4db3d6)[_0xfdd3('0xa')](function(_0x1aa168){logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x663e27,_0xfdd3('0xb'));logger['debug'](_0xfdd3('0xc'),_0x663e27,'request\x20sent',JSON['stringify'](_0x1aa168));if(_0x1aa168[_0xfdd3('0xd')]){if(_0x1aa168['error'][_0xfdd3('0xe')]===0x1f4){logger[_0xfdd3('0xd')](_0xfdd3('0xf'),_0x663e27,_0x1aa168[_0xfdd3('0xd')][_0xfdd3('0x10')]);return _0x24f90a(_0x1aa168[_0xfdd3('0xd')][_0xfdd3('0x10')]);}logger[_0xfdd3('0xd')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x663e27,_0x1aa168[_0xfdd3('0xd')][_0xfdd3('0x10')]);return _0x3e1d6d(_0x1aa168['error']['message']);}else{logger[_0xfdd3('0x11')](_0xfdd3('0xf'),_0x663e27,'request\x20sent');_0x3e1d6d(_0x1aa168[_0xfdd3('0x12')][_0xfdd3('0x10')]);}})[_0xfdd3('0x13')](function(_0x124876){logger[_0xfdd3('0xd')](_0xfdd3('0xf'),_0x663e27,_0x124876);_0x24f90a(_0x124876);});});}