Built motion from commit c116dc8b.|2.6.30
[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 _0x23c4=['client','request','info','JscriptyQuestionReport,\x20%s,\x20%s','debug','stringify','error','code','request\x20sent','message','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x491785,_0x9106a7){var _0x4fb113=function(_0x1c0971){while(--_0x1c0971){_0x491785['push'](_0x491785['shift']());}};_0x4fb113(++_0x9106a7);}(_0x23c4,0x19a));var _0x423c=function(_0x26f4f5,_0x53419e){_0x26f4f5=_0x26f4f5-0x0;var _0x91bf0a=_0x23c4[_0x26f4f5];return _0x91bf0a;};'use strict';var _=require(_0x423c('0x0'));var util=require(_0x423c('0x1'));var moment=require(_0x423c('0x2'));var BPromise=require(_0x423c('0x3'));var rs=require(_0x423c('0x4'));var fs=require('fs');var Redis=require(_0x423c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x423c('0x6'));var logger=require(_0x423c('0x7'))(_0x423c('0x8'));var config=require('../../config/environment');var jayson=require(_0x423c('0x9'));var client=jayson[_0x423c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x18a071,_0x5d6f4a,_0x1f3f06){return new BPromise(function(_0x259e0a,_0x26f5c4){return client[_0x423c('0xb')](_0x18a071,_0x1f3f06)['then'](function(_0x2e9603){logger[_0x423c('0xc')](_0x423c('0xd'),_0x5d6f4a,'request\x20sent');logger[_0x423c('0xe')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x5d6f4a,'request\x20sent',JSON[_0x423c('0xf')](_0x2e9603));if(_0x2e9603[_0x423c('0x10')]){if(_0x2e9603[_0x423c('0x10')][_0x423c('0x11')]===0x1f4){logger['error'](_0x423c('0xd'),_0x5d6f4a,_0x2e9603[_0x423c('0x10')]['message']);return _0x26f5c4(_0x2e9603[_0x423c('0x10')]['message']);}logger[_0x423c('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x5d6f4a,_0x2e9603[_0x423c('0x10')]['message']);return _0x259e0a(_0x2e9603['error']['message']);}else{logger[_0x423c('0xc')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x5d6f4a,_0x423c('0x12'));_0x259e0a(_0x2e9603['result'][_0x423c('0x13')]);}})['catch'](function(_0x2f52ec){logger['error'](_0x423c('0xd'),_0x5d6f4a,_0x2f52ec);_0x26f5c4(_0x2f52ec);});});}