aee3dc2abed9656d58a01f6ee4956c688aa4eb58
[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 _0x0e5b=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash'];(function(_0x30b5d2,_0x45cd68){var _0x101855=function(_0x386276){while(--_0x386276){_0x30b5d2['push'](_0x30b5d2['shift']());}};_0x101855(++_0x45cd68);}(_0x0e5b,0x1e3));var _0xb0e5=function(_0x76e11b,_0x4e5bea){_0x76e11b=_0x76e11b-0x0;var _0x506127=_0x0e5b[_0x76e11b];return _0x506127;};'use strict';var _=require(_0xb0e5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb0e5('0x1'));var rs=require(_0xb0e5('0x2'));var fs=require('fs');var Redis=require(_0xb0e5('0x3'));var db=require(_0xb0e5('0x4'))['db'];var utils=require(_0xb0e5('0x5'));var logger=require(_0xb0e5('0x6'))(_0xb0e5('0x7'));var config=require(_0xb0e5('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb0e5('0x9')][_0xb0e5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ece34,_0x33025d,_0x31a341){return new BPromise(function(_0x406768,_0x492044){return client['request'](_0x1ece34,_0x31a341)[_0xb0e5('0xb')](function(_0x40a750){logger['info'](_0xb0e5('0xc'),_0x33025d,_0xb0e5('0xd'));logger[_0xb0e5('0xe')](_0xb0e5('0xf'),_0x33025d,_0xb0e5('0xd'),JSON['stringify'](_0x40a750));if(_0x40a750['error']){if(_0x40a750[_0xb0e5('0x10')][_0xb0e5('0x11')]===0x1f4){logger[_0xb0e5('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x33025d,_0x40a750[_0xb0e5('0x10')]['message']);return _0x492044(_0x40a750[_0xb0e5('0x10')][_0xb0e5('0x12')]);}logger[_0xb0e5('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x33025d,_0x40a750[_0xb0e5('0x10')][_0xb0e5('0x12')]);return _0x406768(_0x40a750[_0xb0e5('0x10')][_0xb0e5('0x12')]);}else{logger[_0xb0e5('0x13')](_0xb0e5('0xc'),_0x33025d,_0xb0e5('0xd'));_0x406768(_0x40a750[_0xb0e5('0x14')]['message']);}})[_0xb0e5('0x15')](function(_0x48ae23){logger[_0xb0e5('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x33025d,_0x48ae23);_0x492044(_0x48ae23);});});}