Built motion from commit b5996064.|2.6.21
[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 _0xe2ba=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xe2ba,0x87));var _0xae2b=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xe2ba[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xae2b('0x0'));var util=require(_0xae2b('0x1'));var moment=require(_0xae2b('0x2'));var BPromise=require(_0xae2b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xae2b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xae2b('0x5'));var logger=require('../../config/logger')(_0xae2b('0x6'));var config=require(_0xae2b('0x7'));var jayson=require(_0xae2b('0x8'));var client=jayson[_0xae2b('0x9')][_0xae2b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1666fc,_0x10758b,_0x4e93d3){return new BPromise(function(_0x6c92cf,_0x540590){return client['request'](_0x1666fc,_0x4e93d3)['then'](function(_0x33fd42){logger[_0xae2b('0xb')](_0xae2b('0xc'),_0x10758b,_0xae2b('0xd'));logger['debug']('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x10758b,_0xae2b('0xd'),JSON[_0xae2b('0xe')](_0x33fd42));if(_0x33fd42[_0xae2b('0xf')]){if(_0x33fd42[_0xae2b('0xf')][_0xae2b('0x10')]===0x1f4){logger[_0xae2b('0xf')](_0xae2b('0xc'),_0x10758b,_0x33fd42[_0xae2b('0xf')][_0xae2b('0x11')]);return _0x540590(_0x33fd42[_0xae2b('0xf')][_0xae2b('0x11')]);}logger[_0xae2b('0xf')](_0xae2b('0xc'),_0x10758b,_0x33fd42[_0xae2b('0xf')]['message']);return _0x6c92cf(_0x33fd42[_0xae2b('0xf')][_0xae2b('0x11')]);}else{logger['info'](_0xae2b('0xc'),_0x10758b,'request\x20sent');_0x6c92cf(_0x33fd42[_0xae2b('0x12')]['message']);}})[_0xae2b('0x13')](function(_0x36a5a6){logger[_0xae2b('0xf')](_0xae2b('0xc'),_0x10758b,_0x36a5a6);_0x540590(_0x36a5a6);});});}