052c762c63ecbba6cc6a719406cd825dd9bb234b
[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 _0x5fd3=['JscriptyQuestionReport,\x20%s,\x20%s','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info'];(function(_0x311470,_0x3d014e){var _0x44c498=function(_0x41bf2e){while(--_0x41bf2e){_0x311470['push'](_0x311470['shift']());}};_0x44c498(++_0x3d014e);}(_0x5fd3,0xf0));var _0x35fd=function(_0x1b661a,_0xfacbae){_0x1b661a=_0x1b661a-0x0;var _0xfced86=_0x5fd3[_0x1b661a];return _0xfced86;};'use strict';var _=require(_0x35fd('0x0'));var util=require(_0x35fd('0x1'));var moment=require(_0x35fd('0x2'));var BPromise=require('bluebird');var rs=require(_0x35fd('0x3'));var fs=require('fs');var Redis=require(_0x35fd('0x4'));var db=require(_0x35fd('0x5'))['db'];var utils=require(_0x35fd('0x6'));var logger=require(_0x35fd('0x7'))(_0x35fd('0x8'));var config=require(_0x35fd('0x9'));var jayson=require(_0x35fd('0xa'));var client=jayson[_0x35fd('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x664ccb,_0xe4b9ee,_0x1e8c0f){return new BPromise(function(_0x61c5de,_0x2102f5){return client['request'](_0x664ccb,_0x1e8c0f)['then'](function(_0x342417){logger[_0x35fd('0xc')](_0x35fd('0xd'),_0xe4b9ee,'request\x20sent');logger[_0x35fd('0xe')](_0x35fd('0xf'),_0xe4b9ee,_0x35fd('0x10'),JSON[_0x35fd('0x11')](_0x342417));if(_0x342417[_0x35fd('0x12')]){if(_0x342417[_0x35fd('0x12')][_0x35fd('0x13')]===0x1f4){logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0xe4b9ee,_0x342417[_0x35fd('0x12')][_0x35fd('0x14')]);return _0x2102f5(_0x342417['error'][_0x35fd('0x14')]);}logger[_0x35fd('0x12')]('JscriptyQuestionReport,\x20%s,\x20%s',_0xe4b9ee,_0x342417['error'][_0x35fd('0x14')]);return _0x61c5de(_0x342417[_0x35fd('0x12')][_0x35fd('0x14')]);}else{logger[_0x35fd('0xc')](_0x35fd('0xd'),_0xe4b9ee,_0x35fd('0x10'));_0x61c5de(_0x342417[_0x35fd('0x15')][_0x35fd('0x14')]);}})[_0x35fd('0x16')](function(_0x10ab80){logger['error'](_0x35fd('0xd'),_0xe4b9ee,_0x10ab80);_0x2102f5(_0x10ab80);});});}