96b09de36754a3ac2ba706babf0eb8e2341a4141
[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 _0x5834=['message','info','result','catch','lodash','util','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5834,0x90));var _0x4583=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0x5834[_0x1c8c28];return _0x1f59b4;};'use strict';var _=require(_0x4583('0x0'));var util=require(_0x4583('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4583('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x4583('0x3'));var logger=require(_0x4583('0x4'))(_0x4583('0x5'));var config=require(_0x4583('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4583('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x381fd4,_0x5a2f39,_0x47f9e2){return new BPromise(function(_0x382d72,_0x227a48){return client[_0x4583('0x8')](_0x381fd4,_0x47f9e2)[_0x4583('0x9')](function(_0x4e1748){logger['info'](_0x4583('0xa'),_0x5a2f39,_0x4583('0xb'));logger[_0x4583('0xc')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x5a2f39,'request\x20sent',JSON[_0x4583('0xd')](_0x4e1748));if(_0x4e1748[_0x4583('0xe')]){if(_0x4e1748[_0x4583('0xe')][_0x4583('0xf')]===0x1f4){logger[_0x4583('0xe')](_0x4583('0xa'),_0x5a2f39,_0x4e1748[_0x4583('0xe')][_0x4583('0x10')]);return _0x227a48(_0x4e1748['error'][_0x4583('0x10')]);}logger[_0x4583('0xe')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x5a2f39,_0x4e1748[_0x4583('0xe')][_0x4583('0x10')]);return _0x382d72(_0x4e1748[_0x4583('0xe')][_0x4583('0x10')]);}else{logger[_0x4583('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x5a2f39,'request\x20sent');_0x382d72(_0x4e1748[_0x4583('0x12')]['message']);}})[_0x4583('0x13')](function(_0x48a364){logger[_0x4583('0xe')](_0x4583('0xa'),_0x5a2f39,_0x48a364);_0x227a48(_0x48a364);});});}