dce0929df28c85f289a445a82776a6e909cff0d3
[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 _0xbcf1=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','request\x20sent','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','info','result','lodash','util','bluebird'];(function(_0x2ed7e2,_0x205d25){var _0x3dc889=function(_0x4404f7){while(--_0x4404f7){_0x2ed7e2['push'](_0x2ed7e2['shift']());}};_0x3dc889(++_0x205d25);}(_0xbcf1,0xbb));var _0x1bcf=function(_0x495b3d,_0x4d3da4){_0x495b3d=_0x495b3d-0x0;var _0x4cb329=_0xbcf1[_0x495b3d];return _0x4cb329;};'use strict';var _=require(_0x1bcf('0x0'));var util=require(_0x1bcf('0x1'));var moment=require('moment');var BPromise=require(_0x1bcf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1bcf('0x3'));var db=require(_0x1bcf('0x4'))['db'];var utils=require(_0x1bcf('0x5'));var logger=require(_0x1bcf('0x6'))('rpc');var config=require(_0x1bcf('0x7'));var jayson=require(_0x1bcf('0x8'));var client=jayson['client'][_0x1bcf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22a21f,_0x491bc8,_0x41a73e){return new BPromise(function(_0x37835a,_0xe9c18){return client[_0x1bcf('0xa')](_0x22a21f,_0x41a73e)[_0x1bcf('0xb')](function(_0x4434d4){logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x491bc8,_0x1bcf('0xc'));logger['debug']('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x491bc8,_0x1bcf('0xc'),JSON['stringify'](_0x4434d4));if(_0x4434d4[_0x1bcf('0xd')]){if(_0x4434d4[_0x1bcf('0xd')][_0x1bcf('0xe')]===0x1f4){logger[_0x1bcf('0xd')](_0x1bcf('0xf'),_0x491bc8,_0x4434d4[_0x1bcf('0xd')][_0x1bcf('0x10')]);return _0xe9c18(_0x4434d4[_0x1bcf('0xd')][_0x1bcf('0x10')]);}logger[_0x1bcf('0xd')](_0x1bcf('0xf'),_0x491bc8,_0x4434d4[_0x1bcf('0xd')][_0x1bcf('0x10')]);return _0x37835a(_0x4434d4[_0x1bcf('0xd')]['message']);}else{logger[_0x1bcf('0x11')](_0x1bcf('0xf'),_0x491bc8,'request\x20sent');_0x37835a(_0x4434d4[_0x1bcf('0x12')][_0x1bcf('0x10')]);}})['catch'](function(_0x32db73){logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x491bc8,_0x32db73);_0xe9c18(_0x32db73);});});}