Built motion from commit (unavailable).|2.5.6
[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 _0x2a6a=['request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s'];(function(_0x8fb5f8,_0x2b147e){var _0x52894e=function(_0x1525f2){while(--_0x1525f2){_0x8fb5f8['push'](_0x8fb5f8['shift']());}};_0x52894e(++_0x2b147e);}(_0x2a6a,0xc3));var _0xa2a6=function(_0x5e8c7c,_0x3429c6){_0x5e8c7c=_0x5e8c7c-0x0;var _0x48f7bd=_0x2a6a[_0x5e8c7c];return _0x48f7bd;};'use strict';var _=require(_0xa2a6('0x0'));var util=require(_0xa2a6('0x1'));var moment=require(_0xa2a6('0x2'));var BPromise=require(_0xa2a6('0x3'));var rs=require(_0xa2a6('0x4'));var fs=require('fs');var Redis=require(_0xa2a6('0x5'));var db=require(_0xa2a6('0x6'))['db'];var utils=require(_0xa2a6('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xa2a6('0x8'));var jayson=require(_0xa2a6('0x9'));var client=jayson['client'][_0xa2a6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xd0acd7,_0x4e8051,_0x460f4f){return new BPromise(function(_0x56fe59,_0xfff00d){return client[_0xa2a6('0xb')](_0xd0acd7,_0x460f4f)[_0xa2a6('0xc')](function(_0x17f2f8){logger[_0xa2a6('0xd')](_0xa2a6('0xe'),_0x4e8051,_0xa2a6('0xf'));logger['debug'](_0xa2a6('0x10'),_0x4e8051,_0xa2a6('0xf'),JSON[_0xa2a6('0x11')](_0x17f2f8));if(_0x17f2f8[_0xa2a6('0x12')]){if(_0x17f2f8[_0xa2a6('0x12')]['code']===0x1f4){logger[_0xa2a6('0x12')](_0xa2a6('0xe'),_0x4e8051,_0x17f2f8[_0xa2a6('0x12')][_0xa2a6('0x13')]);return _0xfff00d(_0x17f2f8[_0xa2a6('0x12')]['message']);}logger[_0xa2a6('0x12')](_0xa2a6('0xe'),_0x4e8051,_0x17f2f8[_0xa2a6('0x12')][_0xa2a6('0x13')]);return _0x56fe59(_0x17f2f8[_0xa2a6('0x12')]['message']);}else{logger[_0xa2a6('0xd')](_0xa2a6('0xe'),_0x4e8051,'request\x20sent');_0x56fe59(_0x17f2f8[_0xa2a6('0x14')][_0xa2a6('0x13')]);}})['catch'](function(_0x4a9bb8){logger[_0xa2a6('0x12')](_0xa2a6('0xe'),_0x4e8051,_0x4a9bb8);_0xfff00d(_0x4a9bb8);});});}