0e190693f55f0527395f6cc8e113e1d6c56a3fe6
[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 _0x1c34=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x59344e,_0x1a60de){var _0x5b3979=function(_0x6d626e){while(--_0x6d626e){_0x59344e['push'](_0x59344e['shift']());}};_0x5b3979(++_0x1a60de);}(_0x1c34,0x1aa));var _0x41c3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1c34[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x41c3('0x0'));var util=require(_0x41c3('0x1'));var moment=require(_0x41c3('0x2'));var BPromise=require(_0x41c3('0x3'));var rs=require(_0x41c3('0x4'));var fs=require('fs');var Redis=require(_0x41c3('0x5'));var db=require(_0x41c3('0x6'))['db'];var utils=require(_0x41c3('0x7'));var logger=require(_0x41c3('0x8'))(_0x41c3('0x9'));var config=require(_0x41c3('0xa'));var jayson=require(_0x41c3('0xb'));var client=jayson[_0x41c3('0xc')][_0x41c3('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x40166c,_0x4bf814,_0x4a3063){return new BPromise(function(_0x213e50,_0x5288d7){return client[_0x41c3('0xe')](_0x40166c,_0x4a3063)['then'](function(_0x345659){logger['info'](_0x41c3('0xf'),_0x4bf814,_0x41c3('0x10'));logger[_0x41c3('0x11')](_0x41c3('0x12'),_0x4bf814,_0x41c3('0x10'),JSON[_0x41c3('0x13')](_0x345659));if(_0x345659['error']){if(_0x345659[_0x41c3('0x14')][_0x41c3('0x15')]===0x1f4){logger[_0x41c3('0x14')](_0x41c3('0xf'),_0x4bf814,_0x345659[_0x41c3('0x14')]['message']);return _0x5288d7(_0x345659['error'][_0x41c3('0x16')]);}logger[_0x41c3('0x14')](_0x41c3('0xf'),_0x4bf814,_0x345659[_0x41c3('0x14')][_0x41c3('0x16')]);return _0x213e50(_0x345659[_0x41c3('0x14')][_0x41c3('0x16')]);}else{logger['info'](_0x41c3('0xf'),_0x4bf814,'request\x20sent');_0x213e50(_0x345659[_0x41c3('0x17')][_0x41c3('0x16')]);}})[_0x41c3('0x18')](function(_0x3d9de8){logger[_0x41c3('0x14')](_0x41c3('0xf'),_0x4bf814,_0x3d9de8);_0x5288d7(_0x3d9de8);});});}