a3a75a080d6d3f60ddb8b018b22f6f22243ec13f
[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 _0x6f7a=['../../config/environment','jayson/promise','client','info','JscriptyQuestionReport,\x20%s,\x20%s','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x225e96,_0x34273a){var _0x1793c0=function(_0x34f4c5){while(--_0x34f4c5){_0x225e96['push'](_0x225e96['shift']());}};_0x1793c0(++_0x34273a);}(_0x6f7a,0x172));var _0xa6f7=function(_0x108b02,_0x25ff62){_0x108b02=_0x108b02-0x0;var _0x5b78a6=_0x6f7a[_0x108b02];return _0x5b78a6;};'use strict';var _=require('lodash');var util=require(_0xa6f7('0x0'));var moment=require(_0xa6f7('0x1'));var BPromise=require('bluebird');var rs=require(_0xa6f7('0x2'));var fs=require('fs');var Redis=require(_0xa6f7('0x3'));var db=require(_0xa6f7('0x4'))['db'];var utils=require(_0xa6f7('0x5'));var logger=require(_0xa6f7('0x6'))(_0xa6f7('0x7'));var config=require(_0xa6f7('0x8'));var jayson=require(_0xa6f7('0x9'));var client=jayson[_0xa6f7('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x48eb7c,_0x472085,_0x369bde){return new BPromise(function(_0x841526,_0x34ab86){return client['request'](_0x48eb7c,_0x369bde)['then'](function(_0xeb6ffb){logger[_0xa6f7('0xb')](_0xa6f7('0xc'),_0x472085,'request\x20sent');logger[_0xa6f7('0xd')](_0xa6f7('0xe'),_0x472085,_0xa6f7('0xf'),JSON[_0xa6f7('0x10')](_0xeb6ffb));if(_0xeb6ffb['error']){if(_0xeb6ffb[_0xa6f7('0x11')]['code']===0x1f4){logger['error'](_0xa6f7('0xc'),_0x472085,_0xeb6ffb[_0xa6f7('0x11')][_0xa6f7('0x12')]);return _0x34ab86(_0xeb6ffb[_0xa6f7('0x11')][_0xa6f7('0x12')]);}logger[_0xa6f7('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x472085,_0xeb6ffb[_0xa6f7('0x11')]['message']);return _0x841526(_0xeb6ffb['error'][_0xa6f7('0x12')]);}else{logger[_0xa6f7('0xb')](_0xa6f7('0xc'),_0x472085,_0xa6f7('0xf'));_0x841526(_0xeb6ffb[_0xa6f7('0x13')]['message']);}})[_0xa6f7('0x14')](function(_0x28f708){logger['error'](_0xa6f7('0xc'),_0x472085,_0x28f708);_0x34ab86(_0x28f708);});});}