cf2ef85432ab5c99f68fa53783c42d17afc20596
[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 _0x2185=['code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2185,0x1cb));var _0x5218=function(_0x8fca18,_0x23415c){_0x8fca18=_0x8fca18-0x0;var _0x6a9663=_0x2185[_0x8fca18];return _0x6a9663;};'use strict';var _=require('lodash');var util=require(_0x5218('0x0'));var moment=require(_0x5218('0x1'));var BPromise=require(_0x5218('0x2'));var rs=require(_0x5218('0x3'));var fs=require('fs');var Redis=require(_0x5218('0x4'));var db=require(_0x5218('0x5'))['db'];var utils=require(_0x5218('0x6'));var logger=require(_0x5218('0x7'))(_0x5218('0x8'));var config=require(_0x5218('0x9'));var jayson=require(_0x5218('0xa'));var client=jayson['client'][_0x5218('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ec605,_0x24ae68,_0x4dca45){return new BPromise(function(_0xed7939,_0x1b1b41){return client[_0x5218('0xc')](_0x1ec605,_0x4dca45)[_0x5218('0xd')](function(_0x49ee89){logger[_0x5218('0xe')](_0x5218('0xf'),_0x24ae68,_0x5218('0x10'));logger[_0x5218('0x11')](_0x5218('0x12'),_0x24ae68,_0x5218('0x10'),JSON[_0x5218('0x13')](_0x49ee89));if(_0x49ee89[_0x5218('0x14')]){if(_0x49ee89[_0x5218('0x14')][_0x5218('0x15')]===0x1f4){logger[_0x5218('0x14')](_0x5218('0xf'),_0x24ae68,_0x49ee89[_0x5218('0x14')][_0x5218('0x16')]);return _0x1b1b41(_0x49ee89[_0x5218('0x14')][_0x5218('0x16')]);}logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x24ae68,_0x49ee89[_0x5218('0x14')][_0x5218('0x16')]);return _0xed7939(_0x49ee89['error'][_0x5218('0x16')]);}else{logger[_0x5218('0xe')](_0x5218('0xf'),_0x24ae68,'request\x20sent');_0xed7939(_0x49ee89['result']['message']);}})[_0x5218('0x17')](function(_0x7ae816){logger[_0x5218('0x14')](_0x5218('0xf'),_0x24ae68,_0x7ae816);_0x1b1b41(_0x7ae816);});});}