7e18c72ed59a752d3737dc7679fa3d9e6ef82d85
[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 _0x6ea8=['JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','info'];(function(_0x42c4a1,_0xa270a0){var _0x12c702=function(_0x2e7c49){while(--_0x2e7c49){_0x42c4a1['push'](_0x42c4a1['shift']());}};_0x12c702(++_0xa270a0);}(_0x6ea8,0x85));var _0x86ea=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x6ea8[_0x1928c9];return _0x51b5fb;};'use strict';var _=require(_0x86ea('0x0'));var util=require(_0x86ea('0x1'));var moment=require(_0x86ea('0x2'));var BPromise=require(_0x86ea('0x3'));var rs=require(_0x86ea('0x4'));var fs=require('fs');var Redis=require(_0x86ea('0x5'));var db=require(_0x86ea('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x86ea('0x7'))(_0x86ea('0x8'));var config=require('../../config/environment');var jayson=require(_0x86ea('0x9'));var client=jayson[_0x86ea('0xa')][_0x86ea('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x47b18,_0x5b3628,_0x4dc175){return new BPromise(function(_0x36fff9,_0x1969b8){return client['request'](_0x47b18,_0x4dc175)[_0x86ea('0xc')](function(_0x3961a5){logger[_0x86ea('0xd')](_0x86ea('0xe'),_0x5b3628,_0x86ea('0xf'));logger['debug'](_0x86ea('0x10'),_0x5b3628,_0x86ea('0xf'),JSON['stringify'](_0x3961a5));if(_0x3961a5[_0x86ea('0x11')]){if(_0x3961a5['error'][_0x86ea('0x12')]===0x1f4){logger['error'](_0x86ea('0xe'),_0x5b3628,_0x3961a5['error'][_0x86ea('0x13')]);return _0x1969b8(_0x3961a5[_0x86ea('0x11')][_0x86ea('0x13')]);}logger[_0x86ea('0x11')](_0x86ea('0xe'),_0x5b3628,_0x3961a5[_0x86ea('0x11')]['message']);return _0x36fff9(_0x3961a5[_0x86ea('0x11')]['message']);}else{logger[_0x86ea('0xd')](_0x86ea('0xe'),_0x5b3628,_0x86ea('0xf'));_0x36fff9(_0x3961a5['result']['message']);}})[_0x86ea('0x14')](function(_0x215bbc){logger[_0x86ea('0x11')](_0x86ea('0xe'),_0x5b3628,_0x215bbc);_0x1969b8(_0x215bbc);});});}