b3ab089ad0c2c8d3bb4bbe12f03771c8ee7fa629
[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 _0x7e24=['message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code'];(function(_0x1064bc,_0x206f12){var _0x5edc45=function(_0x5087bd){while(--_0x5087bd){_0x1064bc['push'](_0x1064bc['shift']());}};_0x5edc45(++_0x206f12);}(_0x7e24,0x70));var _0x47e2=function(_0x37f567,_0xf73a48){_0x37f567=_0x37f567-0x0;var _0x25d52f=_0x7e24[_0x37f567];return _0x25d52f;};'use strict';var _=require('lodash');var util=require(_0x47e2('0x0'));var moment=require(_0x47e2('0x1'));var BPromise=require(_0x47e2('0x2'));var rs=require(_0x47e2('0x3'));var fs=require('fs');var Redis=require(_0x47e2('0x4'));var db=require(_0x47e2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x47e2('0x6'))(_0x47e2('0x7'));var config=require(_0x47e2('0x8'));var jayson=require(_0x47e2('0x9'));var client=jayson[_0x47e2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f5639,_0x464bf4,_0x55862c){return new BPromise(function(_0x5a0224,_0x2beb4d){return client[_0x47e2('0xb')](_0x4f5639,_0x55862c)[_0x47e2('0xc')](function(_0x3b87c0){logger[_0x47e2('0xd')](_0x47e2('0xe'),_0x464bf4,'request\x20sent');logger[_0x47e2('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x464bf4,_0x47e2('0x10'),JSON[_0x47e2('0x11')](_0x3b87c0));if(_0x3b87c0[_0x47e2('0x12')]){if(_0x3b87c0[_0x47e2('0x12')][_0x47e2('0x13')]===0x1f4){logger[_0x47e2('0x12')](_0x47e2('0xe'),_0x464bf4,_0x3b87c0['error'][_0x47e2('0x14')]);return _0x2beb4d(_0x3b87c0[_0x47e2('0x12')][_0x47e2('0x14')]);}logger[_0x47e2('0x12')](_0x47e2('0xe'),_0x464bf4,_0x3b87c0[_0x47e2('0x12')][_0x47e2('0x14')]);return _0x5a0224(_0x3b87c0['error'][_0x47e2('0x14')]);}else{logger['info'](_0x47e2('0xe'),_0x464bf4,_0x47e2('0x10'));_0x5a0224(_0x3b87c0[_0x47e2('0x15')][_0x47e2('0x14')]);}})['catch'](function(_0x4dd1ac){logger[_0x47e2('0x12')](_0x47e2('0xe'),_0x464bf4,_0x4dd1ac);_0x2beb4d(_0x4dd1ac);});});}