6c2b92da36eac5225fe61e1b74cbbd5021812274
[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 _0x8d9e=['info','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','JscriptyQuestionReport,\x20%s,\x20%s','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x782071,_0x278cee){var _0x9c7802=function(_0x746de0){while(--_0x746de0){_0x782071['push'](_0x782071['shift']());}};_0x9c7802(++_0x278cee);}(_0x8d9e,0x79));var _0xe8d9=function(_0x456b86,_0x42ca24){_0x456b86=_0x456b86-0x0;var _0x2cd607=_0x8d9e[_0x456b86];return _0x2cd607;};'use strict';var _=require(_0xe8d9('0x0'));var util=require(_0xe8d9('0x1'));var moment=require(_0xe8d9('0x2'));var BPromise=require(_0xe8d9('0x3'));var rs=require(_0xe8d9('0x4'));var fs=require('fs');var Redis=require(_0xe8d9('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe8d9('0x6'))(_0xe8d9('0x7'));var config=require(_0xe8d9('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe8d9('0x9')][_0xe8d9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3db472,_0xf16b80,_0x4703d1){return new BPromise(function(_0x5506ff,_0x3e561e){return client[_0xe8d9('0xb')](_0x3db472,_0x4703d1)['then'](function(_0x48d6f3){logger['info'](_0xe8d9('0xc'),_0xf16b80,'request\x20sent');logger['debug'](_0xe8d9('0xd'),_0xf16b80,_0xe8d9('0xe'),JSON[_0xe8d9('0xf')](_0x48d6f3));if(_0x48d6f3[_0xe8d9('0x10')]){if(_0x48d6f3[_0xe8d9('0x10')][_0xe8d9('0x11')]===0x1f4){logger[_0xe8d9('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s',_0xf16b80,_0x48d6f3['error'][_0xe8d9('0x12')]);return _0x3e561e(_0x48d6f3[_0xe8d9('0x10')][_0xe8d9('0x12')]);}logger['error'](_0xe8d9('0xc'),_0xf16b80,_0x48d6f3['error'][_0xe8d9('0x12')]);return _0x5506ff(_0x48d6f3[_0xe8d9('0x10')][_0xe8d9('0x12')]);}else{logger[_0xe8d9('0x13')]('JscriptyQuestionReport,\x20%s,\x20%s',_0xf16b80,_0xe8d9('0xe'));_0x5506ff(_0x48d6f3['result'][_0xe8d9('0x12')]);}})['catch'](function(_0x2d15fc){logger[_0xe8d9('0x10')](_0xe8d9('0xc'),_0xf16b80,_0x2d15fc);_0x3e561e(_0x2d15fc);});});}