c838a055788ef4bdb6ce20f6ea67f11f5be687ad
[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 _0x6b39=['result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x366306,_0x485c8d){var _0x17d02c=function(_0x4882bf){while(--_0x4882bf){_0x366306['push'](_0x366306['shift']());}};_0x17d02c(++_0x485c8d);}(_0x6b39,0x66));var _0x96b3=function(_0x326c82,_0x34a08a){_0x326c82=_0x326c82-0x0;var _0x57e5f0=_0x6b39[_0x326c82];return _0x57e5f0;};'use strict';var _=require(_0x96b3('0x0'));var util=require(_0x96b3('0x1'));var moment=require('moment');var BPromise=require(_0x96b3('0x2'));var rs=require(_0x96b3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x96b3('0x4'))['db'];var utils=require(_0x96b3('0x5'));var logger=require(_0x96b3('0x6'))(_0x96b3('0x7'));var config=require(_0x96b3('0x8'));var jayson=require(_0x96b3('0x9'));var client=jayson[_0x96b3('0xa')][_0x96b3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x35427a,_0x1029a7,_0x52ff4f){return new BPromise(function(_0x44c25b,_0x32307f){return client[_0x96b3('0xc')](_0x35427a,_0x52ff4f)[_0x96b3('0xd')](function(_0x1edda8){logger[_0x96b3('0xe')](_0x96b3('0xf'),_0x1029a7,_0x96b3('0x10'));logger[_0x96b3('0x11')](_0x96b3('0x12'),_0x1029a7,'request\x20sent',JSON[_0x96b3('0x13')](_0x1edda8));if(_0x1edda8[_0x96b3('0x14')]){if(_0x1edda8[_0x96b3('0x14')][_0x96b3('0x15')]===0x1f4){logger[_0x96b3('0x14')](_0x96b3('0xf'),_0x1029a7,_0x1edda8[_0x96b3('0x14')][_0x96b3('0x16')]);return _0x32307f(_0x1edda8[_0x96b3('0x14')][_0x96b3('0x16')]);}logger[_0x96b3('0x14')](_0x96b3('0xf'),_0x1029a7,_0x1edda8[_0x96b3('0x14')][_0x96b3('0x16')]);return _0x44c25b(_0x1edda8[_0x96b3('0x14')][_0x96b3('0x16')]);}else{logger[_0x96b3('0xe')](_0x96b3('0xf'),_0x1029a7,_0x96b3('0x10'));_0x44c25b(_0x1edda8[_0x96b3('0x17')][_0x96b3('0x16')]);}})[_0x96b3('0x18')](function(_0x34235a){logger[_0x96b3('0x14')](_0x96b3('0xf'),_0x1029a7,_0x34235a);_0x32307f(_0x34235a);});});}