d2de39a086160d7dfe6b99960b4e4fb65bcb729d
[motion2.git] / server / api / jscriptyQuestionReport / jscriptyQuestionReport.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 _0xc3bd=['debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc3bd,0xe4));var _0xdc3b=function(_0x15078f,_0xe9adbb){_0x15078f=_0x15078f-0x0;var _0xaad20=_0xc3bd[_0x15078f];return _0xaad20;};'use strict';var _=require(_0xdc3b('0x0'));var util=require(_0xdc3b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xdc3b('0x2'));var fs=require('fs');var Redis=require(_0xdc3b('0x3'));var db=require(_0xdc3b('0x4'))['db'];var utils=require(_0xdc3b('0x5'));var logger=require('../../config/logger')(_0xdc3b('0x6'));var config=require('../../config/environment');var jayson=require(_0xdc3b('0x7'));var client=jayson[_0xdc3b('0x8')][_0xdc3b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x170e4c,_0x474ac5,_0x13c4d4){return new BPromise(function(_0x4c1869,_0x2401c6){return client['request'](_0x170e4c,_0x13c4d4)[_0xdc3b('0xa')](function(_0x16c312){logger[_0xdc3b('0xb')](_0xdc3b('0xc'),_0x474ac5,_0xdc3b('0xd'));logger[_0xdc3b('0xe')](_0xdc3b('0xf'),_0x474ac5,'request\x20sent',JSON[_0xdc3b('0x10')](_0x16c312));if(_0x16c312[_0xdc3b('0x11')]){if(_0x16c312[_0xdc3b('0x11')][_0xdc3b('0x12')]===0x1f4){logger[_0xdc3b('0x11')](_0xdc3b('0xc'),_0x474ac5,_0x16c312[_0xdc3b('0x11')]['message']);return _0x2401c6(_0x16c312[_0xdc3b('0x11')][_0xdc3b('0x13')]);}logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x474ac5,_0x16c312[_0xdc3b('0x11')]['message']);return _0x4c1869(_0x16c312[_0xdc3b('0x11')][_0xdc3b('0x13')]);}else{logger[_0xdc3b('0xb')](_0xdc3b('0xc'),_0x474ac5,_0xdc3b('0xd'));_0x4c1869(_0x16c312[_0xdc3b('0x14')][_0xdc3b('0x13')]);}})[_0xdc3b('0x15')](function(_0x1ca59b){logger[_0xdc3b('0x11')](_0xdc3b('0xc'),_0x474ac5,_0x1ca59b);_0x2401c6(_0x1ca59b);});});}