Built motion from commit ff78e754.|2.6.29
[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 _0xaa9e=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x23b655,_0x4feb2b){var _0x364b32=function(_0x4e41ac){while(--_0x4e41ac){_0x23b655['push'](_0x23b655['shift']());}};_0x364b32(++_0x4feb2b);}(_0xaa9e,0x8f));var _0xeaa9=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0xaa9e[_0x17928f];return _0x500b63;};'use strict';var _=require(_0xeaa9('0x0'));var util=require(_0xeaa9('0x1'));var moment=require(_0xeaa9('0x2'));var BPromise=require('bluebird');var rs=require(_0xeaa9('0x3'));var fs=require('fs');var Redis=require(_0xeaa9('0x4'));var db=require(_0xeaa9('0x5'))['db'];var utils=require(_0xeaa9('0x6'));var logger=require(_0xeaa9('0x7'))(_0xeaa9('0x8'));var config=require(_0xeaa9('0x9'));var jayson=require(_0xeaa9('0xa'));var client=jayson[_0xeaa9('0xb')][_0xeaa9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5d8217,_0x4c1de3,_0x5bf071){return new BPromise(function(_0xb9a4d9,_0x5a2b1f){return client[_0xeaa9('0xd')](_0x5d8217,_0x5bf071)['then'](function(_0x4aa91e){logger[_0xeaa9('0xe')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x4c1de3,_0xeaa9('0xf'));logger['debug'](_0xeaa9('0x10'),_0x4c1de3,'request\x20sent',JSON[_0xeaa9('0x11')](_0x4aa91e));if(_0x4aa91e[_0xeaa9('0x12')]){if(_0x4aa91e[_0xeaa9('0x12')][_0xeaa9('0x13')]===0x1f4){logger[_0xeaa9('0x12')](_0xeaa9('0x14'),_0x4c1de3,_0x4aa91e[_0xeaa9('0x12')][_0xeaa9('0x15')]);return _0x5a2b1f(_0x4aa91e['error'][_0xeaa9('0x15')]);}logger[_0xeaa9('0x12')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x4c1de3,_0x4aa91e[_0xeaa9('0x12')][_0xeaa9('0x15')]);return _0xb9a4d9(_0x4aa91e[_0xeaa9('0x12')][_0xeaa9('0x15')]);}else{logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x4c1de3,_0xeaa9('0xf'));_0xb9a4d9(_0x4aa91e[_0xeaa9('0x16')][_0xeaa9('0x15')]);}})[_0xeaa9('0x17')](function(_0x627833){logger[_0xeaa9('0x12')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x4c1de3,_0x627833);_0x5a2b1f(_0x627833);});});}