Built motion from commit (unavailable).|2.5.29
[motion2.git] / server / api / jscriptyAnswerReport / jscriptyAnswerReport.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 _0x28e9=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x8d0a71,_0x48c520){var _0x27c34c=function(_0x46e7ae){while(--_0x46e7ae){_0x8d0a71['push'](_0x8d0a71['shift']());}};_0x27c34c(++_0x48c520);}(_0x28e9,0x19f));var _0x928e=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x28e9[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x928e('0x0'));var util=require(_0x928e('0x1'));var moment=require(_0x928e('0x2'));var BPromise=require(_0x928e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x928e('0x4'));var db=require(_0x928e('0x5'))['db'];var utils=require(_0x928e('0x6'));var logger=require(_0x928e('0x7'))(_0x928e('0x8'));var config=require('../../config/environment');var jayson=require(_0x928e('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4792a5,_0x142721,_0x23dd70){return new BPromise(function(_0x14d843,_0x114267){return client[_0x928e('0xa')](_0x4792a5,_0x23dd70)[_0x928e('0xb')](function(_0x3893ae){logger['info'](_0x928e('0xc'),_0x142721,_0x928e('0xd'));logger['debug'](_0x928e('0xe'),_0x142721,_0x928e('0xd'),JSON[_0x928e('0xf')](_0x3893ae));if(_0x3893ae[_0x928e('0x10')]){if(_0x3893ae[_0x928e('0x10')]['code']===0x1f4){logger[_0x928e('0x10')](_0x928e('0xc'),_0x142721,_0x3893ae['error']['message']);return _0x114267(_0x3893ae[_0x928e('0x10')]['message']);}logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x142721,_0x3893ae[_0x928e('0x10')][_0x928e('0x11')]);return _0x14d843(_0x3893ae[_0x928e('0x10')][_0x928e('0x11')]);}else{logger[_0x928e('0x12')](_0x928e('0xc'),_0x142721,_0x928e('0xd'));_0x14d843(_0x3893ae[_0x928e('0x13')][_0x928e('0x11')]);}})[_0x928e('0x14')](function(_0x477dac){logger['error'](_0x928e('0xc'),_0x142721,_0x477dac);_0x114267(_0x477dac);});});}