6fba71006478e6d82726dc22d291f89c63eac5dc
[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 _0x5419=['debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','JscriptyQuestionReport,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x3fa7d3,_0x37f83c){var _0x4c51bd=function(_0x59e85b){while(--_0x59e85b){_0x3fa7d3['push'](_0x3fa7d3['shift']());}};_0x4c51bd(++_0x37f83c);}(_0x5419,0x18f));var _0x9541=function(_0x1cbba9,_0x477bf5){_0x1cbba9=_0x1cbba9-0x0;var _0x14c91d=_0x5419[_0x1cbba9];return _0x14c91d;};'use strict';var _=require(_0x9541('0x0'));var util=require(_0x9541('0x1'));var moment=require('moment');var BPromise=require(_0x9541('0x2'));var rs=require(_0x9541('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9541('0x4'))['db'];var utils=require(_0x9541('0x5'));var logger=require(_0x9541('0x6'))('rpc');var config=require(_0x9541('0x7'));var jayson=require(_0x9541('0x8'));var client=jayson[_0x9541('0x9')][_0x9541('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2d87ed,_0x423fe0,_0x227c2d){return new BPromise(function(_0xc36bc,_0x73b75e){return client[_0x9541('0xb')](_0x2d87ed,_0x227c2d)[_0x9541('0xc')](function(_0x35fc7f){logger[_0x9541('0xd')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x423fe0,_0x9541('0xe'));logger[_0x9541('0xf')](_0x9541('0x10'),_0x423fe0,_0x9541('0xe'),JSON[_0x9541('0x11')](_0x35fc7f));if(_0x35fc7f['error']){if(_0x35fc7f['error'][_0x9541('0x12')]===0x1f4){logger[_0x9541('0x13')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x423fe0,_0x35fc7f[_0x9541('0x13')]['message']);return _0x73b75e(_0x35fc7f[_0x9541('0x13')]['message']);}logger[_0x9541('0x13')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x423fe0,_0x35fc7f[_0x9541('0x13')]['message']);return _0xc36bc(_0x35fc7f[_0x9541('0x13')][_0x9541('0x14')]);}else{logger['info'](_0x9541('0x15'),_0x423fe0,_0x9541('0xe'));_0xc36bc(_0x35fc7f['result'][_0x9541('0x14')]);}})[_0x9541('0x16')](function(_0x585575){logger[_0x9541('0x13')](_0x9541('0x15'),_0x423fe0,_0x585575);_0x73b75e(_0x585575);});});}