Built motion from commit (unavailable).|2.4.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 _0x3b76=['rpc','../../config/environment','jayson/promise','http','request','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3bbff0,_0x194278){var _0x1366d3=function(_0x1a6215){while(--_0x1a6215){_0x3bbff0['push'](_0x3bbff0['shift']());}};_0x1366d3(++_0x194278);}(_0x3b76,0xeb));var _0x63b7=function(_0x53f79d,_0x570d4e){_0x53f79d=_0x53f79d-0x0;var _0x5ec922=_0x3b76[_0x53f79d];return _0x5ec922;};'use strict';var _=require('lodash');var util=require(_0x63b7('0x0'));var moment=require(_0x63b7('0x1'));var BPromise=require(_0x63b7('0x2'));var rs=require(_0x63b7('0x3'));var fs=require('fs');var Redis=require(_0x63b7('0x4'));var db=require(_0x63b7('0x5'))['db'];var utils=require(_0x63b7('0x6'));var logger=require('../../config/logger')(_0x63b7('0x7'));var config=require(_0x63b7('0x8'));var jayson=require(_0x63b7('0x9'));var client=jayson['client'][_0x63b7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa727e,_0x1133a8,_0x3b03af){return new BPromise(function(_0x7f7c1b,_0x4898de){return client[_0x63b7('0xb')](_0xa727e,_0x3b03af)['then'](function(_0x2d25cc){logger['info'](_0x63b7('0xc'),_0x1133a8,_0x63b7('0xd'));logger[_0x63b7('0xe')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x1133a8,_0x63b7('0xd'),JSON[_0x63b7('0xf')](_0x2d25cc));if(_0x2d25cc[_0x63b7('0x10')]){if(_0x2d25cc[_0x63b7('0x10')][_0x63b7('0x11')]===0x1f4){logger[_0x63b7('0x10')](_0x63b7('0xc'),_0x1133a8,_0x2d25cc[_0x63b7('0x10')][_0x63b7('0x12')]);return _0x4898de(_0x2d25cc['error']['message']);}logger[_0x63b7('0x10')](_0x63b7('0xc'),_0x1133a8,_0x2d25cc['error']['message']);return _0x7f7c1b(_0x2d25cc['error'][_0x63b7('0x12')]);}else{logger[_0x63b7('0x13')](_0x63b7('0xc'),_0x1133a8,'request\x20sent');_0x7f7c1b(_0x2d25cc[_0x63b7('0x14')][_0x63b7('0x12')]);}})[_0x63b7('0x15')](function(_0x143540){logger[_0x63b7('0x10')](_0x63b7('0xc'),_0x1133a8,_0x143540);_0x4898de(_0x143540);});});}