Built motion from commit 9d1906d1.|2.5.40
[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 _0x5113=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x1b423b,_0x48afc1){var _0x482b03=function(_0x46e585){while(--_0x46e585){_0x1b423b['push'](_0x1b423b['shift']());}};_0x482b03(++_0x48afc1);}(_0x5113,0x13e));var _0x3511=function(_0x50859e,_0x2c958a){_0x50859e=_0x50859e-0x0;var _0x5847a2=_0x5113[_0x50859e];return _0x5847a2;};'use strict';var _=require(_0x3511('0x0'));var util=require(_0x3511('0x1'));var moment=require(_0x3511('0x2'));var BPromise=require(_0x3511('0x3'));var rs=require(_0x3511('0x4'));var fs=require('fs');var Redis=require(_0x3511('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3511('0x6'));var logger=require(_0x3511('0x7'))(_0x3511('0x8'));var config=require(_0x3511('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3511('0xa')][_0x3511('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5ab279,_0xdfe6b9,_0x59466e){return new BPromise(function(_0x264414,_0x6543b7){return client[_0x3511('0xc')](_0x5ab279,_0x59466e)['then'](function(_0x5e5a5c){logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0xdfe6b9,_0x3511('0xd'));logger[_0x3511('0xe')](_0x3511('0xf'),_0xdfe6b9,'request\x20sent',JSON[_0x3511('0x10')](_0x5e5a5c));if(_0x5e5a5c[_0x3511('0x11')]){if(_0x5e5a5c['error'][_0x3511('0x12')]===0x1f4){logger[_0x3511('0x11')](_0x3511('0x13'),_0xdfe6b9,_0x5e5a5c[_0x3511('0x11')]['message']);return _0x6543b7(_0x5e5a5c[_0x3511('0x11')]['message']);}logger[_0x3511('0x11')](_0x3511('0x13'),_0xdfe6b9,_0x5e5a5c[_0x3511('0x11')][_0x3511('0x14')]);return _0x264414(_0x5e5a5c['error'][_0x3511('0x14')]);}else{logger['info'](_0x3511('0x13'),_0xdfe6b9,_0x3511('0xd'));_0x264414(_0x5e5a5c[_0x3511('0x15')][_0x3511('0x14')]);}})[_0x3511('0x16')](function(_0x3ca437){logger[_0x3511('0x11')](_0x3511('0x13'),_0xdfe6b9,_0x3ca437);_0x6543b7(_0x3ca437);});});}