Built motion from commit 775e2a94.|2.6.3
[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 _0x6753=['request','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http'];(function(_0x16503d,_0x2a47e2){var _0x62d1bb=function(_0x1857d9){while(--_0x1857d9){_0x16503d['push'](_0x16503d['shift']());}};_0x62d1bb(++_0x2a47e2);}(_0x6753,0x78));var _0x3675=function(_0x334baf,_0x47d9f4){_0x334baf=_0x334baf-0x0;var _0x3f28df=_0x6753[_0x334baf];return _0x3f28df;};'use strict';var _=require(_0x3675('0x0'));var util=require(_0x3675('0x1'));var moment=require(_0x3675('0x2'));var BPromise=require(_0x3675('0x3'));var rs=require(_0x3675('0x4'));var fs=require('fs');var Redis=require(_0x3675('0x5'));var db=require(_0x3675('0x6'))['db'];var utils=require(_0x3675('0x7'));var logger=require(_0x3675('0x8'))(_0x3675('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3675('0xa')][_0x3675('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x180bf0,_0x30b8aa,_0x302aec){return new BPromise(function(_0x5c3ba8,_0x532fd9){return client[_0x3675('0xc')](_0x180bf0,_0x302aec)['then'](function(_0x3819ae){logger[_0x3675('0xd')](_0x3675('0xe'),_0x30b8aa,_0x3675('0xf'));logger[_0x3675('0x10')](_0x3675('0x11'),_0x30b8aa,'request\x20sent',JSON[_0x3675('0x12')](_0x3819ae));if(_0x3819ae[_0x3675('0x13')]){if(_0x3819ae['error']['code']===0x1f4){logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x30b8aa,_0x3819ae[_0x3675('0x13')][_0x3675('0x14')]);return _0x532fd9(_0x3819ae['error'][_0x3675('0x14')]);}logger[_0x3675('0x13')](_0x3675('0xe'),_0x30b8aa,_0x3819ae[_0x3675('0x13')][_0x3675('0x14')]);return _0x5c3ba8(_0x3819ae['error']['message']);}else{logger[_0x3675('0xd')](_0x3675('0xe'),_0x30b8aa,_0x3675('0xf'));_0x5c3ba8(_0x3819ae[_0x3675('0x15')][_0x3675('0x14')]);}})['catch'](function(_0x6378d8){logger[_0x3675('0x13')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x30b8aa,_0x6378d8);_0x532fd9(_0x6378d8);});});}