d06721eece667085ac9297a852d1ac93c50fdc07
[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 _0x7641=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','bluebird','../../mysqldb','../../config/utils'];(function(_0x9729d7,_0x1b79a8){var _0x3c4ac6=function(_0x401ba6){while(--_0x401ba6){_0x9729d7['push'](_0x9729d7['shift']());}};_0x3c4ac6(++_0x1b79a8);}(_0x7641,0x15c));var _0x1764=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x7641[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require(_0x1764('0x0'));var moment=require('moment');var BPromise=require(_0x1764('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1764('0x2'))['db'];var utils=require(_0x1764('0x3'));var logger=require(_0x1764('0x4'))(_0x1764('0x5'));var config=require(_0x1764('0x6'));var jayson=require(_0x1764('0x7'));var client=jayson['client'][_0x1764('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1567c9,_0x2c4e62,_0x3ae1b9){return new BPromise(function(_0x5e902b,_0x1c4434){return client[_0x1764('0x9')](_0x1567c9,_0x3ae1b9)[_0x1764('0xa')](function(_0x2ba103){logger[_0x1764('0xb')](_0x1764('0xc'),_0x2c4e62,'request\x20sent');logger[_0x1764('0xd')](_0x1764('0xe'),_0x2c4e62,_0x1764('0xf'),JSON[_0x1764('0x10')](_0x2ba103));if(_0x2ba103[_0x1764('0x11')]){if(_0x2ba103[_0x1764('0x11')][_0x1764('0x12')]===0x1f4){logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x2c4e62,_0x2ba103['error'][_0x1764('0x13')]);return _0x1c4434(_0x2ba103[_0x1764('0x11')][_0x1764('0x13')]);}logger[_0x1764('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x2c4e62,_0x2ba103[_0x1764('0x11')][_0x1764('0x13')]);return _0x5e902b(_0x2ba103[_0x1764('0x11')]['message']);}else{logger[_0x1764('0xb')](_0x1764('0xc'),_0x2c4e62,'request\x20sent');_0x5e902b(_0x2ba103[_0x1764('0x14')][_0x1764('0x13')]);}})[_0x1764('0x15')](function(_0xd3987b){logger[_0x1764('0x11')](_0x1764('0xc'),_0x2c4e62,_0xd3987b);_0x1c4434(_0xd3987b);});});}