Built motion from commit 616d3211.|2.6.4
[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 _0xe3b5=['rpc','../../config/environment','jayson/promise','client','request','then','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0xfa3e07,_0x15436d){var _0x132828=function(_0x52a9bd){while(--_0x52a9bd){_0xfa3e07['push'](_0xfa3e07['shift']());}};_0x132828(++_0x15436d);}(_0xe3b5,0x1f4));var _0x5e3b=function(_0x5a7b7e,_0xe10e12){_0x5a7b7e=_0x5a7b7e-0x0;var _0x313f44=_0xe3b5[_0x5a7b7e];return _0x313f44;};'use strict';var _=require('lodash');var util=require(_0x5e3b('0x0'));var moment=require(_0x5e3b('0x1'));var BPromise=require(_0x5e3b('0x2'));var rs=require(_0x5e3b('0x3'));var fs=require('fs');var Redis=require(_0x5e3b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5e3b('0x5'));var logger=require('../../config/logger')(_0x5e3b('0x6'));var config=require(_0x5e3b('0x7'));var jayson=require(_0x5e3b('0x8'));var client=jayson[_0x5e3b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x46b78a,_0x2d2d65,_0x108514){return new BPromise(function(_0xd79d71,_0x2313bb){return client[_0x5e3b('0xa')](_0x46b78a,_0x108514)[_0x5e3b('0xb')](function(_0x6eed2){logger['info'](_0x5e3b('0xc'),_0x2d2d65,_0x5e3b('0xd'));logger[_0x5e3b('0xe')](_0x5e3b('0xf'),_0x2d2d65,'request\x20sent',JSON[_0x5e3b('0x10')](_0x6eed2));if(_0x6eed2[_0x5e3b('0x11')]){if(_0x6eed2[_0x5e3b('0x11')][_0x5e3b('0x12')]===0x1f4){logger[_0x5e3b('0x11')](_0x5e3b('0xc'),_0x2d2d65,_0x6eed2['error'][_0x5e3b('0x13')]);return _0x2313bb(_0x6eed2[_0x5e3b('0x11')][_0x5e3b('0x13')]);}logger[_0x5e3b('0x11')](_0x5e3b('0xc'),_0x2d2d65,_0x6eed2[_0x5e3b('0x11')][_0x5e3b('0x13')]);return _0xd79d71(_0x6eed2[_0x5e3b('0x11')][_0x5e3b('0x13')]);}else{logger[_0x5e3b('0x14')](_0x5e3b('0xc'),_0x2d2d65,_0x5e3b('0xd'));_0xd79d71(_0x6eed2[_0x5e3b('0x15')]['message']);}})[_0x5e3b('0x16')](function(_0x3304cd){logger[_0x5e3b('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x2d2d65,_0x3304cd);_0x2313bb(_0x3304cd);});});}