eff391a11e4697b0c5178ee78facee76b12f999c
[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 _0xf03a=['JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf03a,0xce));var _0xaf03=function(_0x533c62,_0x500760){_0x533c62=_0x533c62-0x0;var _0x17050e=_0xf03a[_0x533c62];return _0x17050e;};'use strict';var _=require(_0xaf03('0x0'));var util=require(_0xaf03('0x1'));var moment=require(_0xaf03('0x2'));var BPromise=require(_0xaf03('0x3'));var rs=require(_0xaf03('0x4'));var fs=require('fs');var Redis=require(_0xaf03('0x5'));var db=require(_0xaf03('0x6'))['db'];var utils=require(_0xaf03('0x7'));var logger=require(_0xaf03('0x8'))('rpc');var config=require(_0xaf03('0x9'));var jayson=require(_0xaf03('0xa'));var client=jayson[_0xaf03('0xb')][_0xaf03('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x43ccd9,_0x3275a5,_0x45f6f7){return new BPromise(function(_0x4dd32b,_0x1a2bdb){return client['request'](_0x43ccd9,_0x45f6f7)['then'](function(_0x1b5dcc){logger[_0xaf03('0xd')](_0xaf03('0xe'),_0x3275a5,_0xaf03('0xf'));logger['debug'](_0xaf03('0x10'),_0x3275a5,'request\x20sent',JSON[_0xaf03('0x11')](_0x1b5dcc));if(_0x1b5dcc[_0xaf03('0x12')]){if(_0x1b5dcc[_0xaf03('0x12')]['code']===0x1f4){logger[_0xaf03('0x12')](_0xaf03('0xe'),_0x3275a5,_0x1b5dcc[_0xaf03('0x12')][_0xaf03('0x13')]);return _0x1a2bdb(_0x1b5dcc['error'][_0xaf03('0x13')]);}logger[_0xaf03('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x3275a5,_0x1b5dcc['error'][_0xaf03('0x13')]);return _0x4dd32b(_0x1b5dcc['error'][_0xaf03('0x13')]);}else{logger[_0xaf03('0xd')](_0xaf03('0xe'),_0x3275a5,_0xaf03('0xf'));_0x4dd32b(_0x1b5dcc[_0xaf03('0x14')][_0xaf03('0x13')]);}})[_0xaf03('0x15')](function(_0x22ddec){logger[_0xaf03('0x12')](_0xaf03('0xe'),_0x3275a5,_0x22ddec);_0x1a2bdb(_0x22ddec);});});}