8a49515ddc7b1d9a1034a5d8bd943134887bc52c
[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 _0xb07a=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','JscriptyAnswerReport,\x20%s,\x20%s','lodash','util','moment','randomstring'];(function(_0x2686ae,_0x381ca8){var _0xf670ea=function(_0x44f865){while(--_0x44f865){_0x2686ae['push'](_0x2686ae['shift']());}};_0xf670ea(++_0x381ca8);}(_0xb07a,0x1a0));var _0xab07=function(_0x2fc130,_0x1e4dc0){_0x2fc130=_0x2fc130-0x0;var _0xd5a6d1=_0xb07a[_0x2fc130];return _0xd5a6d1;};'use strict';var _=require(_0xab07('0x0'));var util=require(_0xab07('0x1'));var moment=require(_0xab07('0x2'));var BPromise=require('bluebird');var rs=require(_0xab07('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xab07('0x4'))['db'];var utils=require(_0xab07('0x5'));var logger=require(_0xab07('0x6'))(_0xab07('0x7'));var config=require('../../config/environment');var jayson=require(_0xab07('0x8'));var client=jayson[_0xab07('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4bc998,_0x29ab00,_0x48972a){return new BPromise(function(_0x280681,_0x5ab1e4){return client[_0xab07('0xa')](_0x4bc998,_0x48972a)[_0xab07('0xb')](function(_0x4a5c15){logger[_0xab07('0xc')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x29ab00,_0xab07('0xd'));logger[_0xab07('0xe')](_0xab07('0xf'),_0x29ab00,_0xab07('0xd'),JSON[_0xab07('0x10')](_0x4a5c15));if(_0x4a5c15['error']){if(_0x4a5c15['error'][_0xab07('0x11')]===0x1f4){logger[_0xab07('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x29ab00,_0x4a5c15[_0xab07('0x12')][_0xab07('0x13')]);return _0x5ab1e4(_0x4a5c15['error'][_0xab07('0x13')]);}logger[_0xab07('0x12')](_0xab07('0x14'),_0x29ab00,_0x4a5c15['error'][_0xab07('0x13')]);return _0x280681(_0x4a5c15['error'][_0xab07('0x13')]);}else{logger[_0xab07('0xc')](_0xab07('0x14'),_0x29ab00,_0xab07('0xd'));_0x280681(_0x4a5c15['result'][_0xab07('0x13')]);}})['catch'](function(_0x11b173){logger[_0xab07('0x12')](_0xab07('0x14'),_0x29ab00,_0x11b173);_0x5ab1e4(_0x11b173);});});}