Built motion from commit 10af8726.|2.6.34
[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 _0x353f=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','util'];(function(_0x11610d,_0x591224){var _0x3f751a=function(_0x4f68fd){while(--_0x4f68fd){_0x11610d['push'](_0x11610d['shift']());}};_0x3f751a(++_0x591224);}(_0x353f,0x117));var _0xf353=function(_0x3df408,_0x508050){_0x3df408=_0x3df408-0x0;var _0x3f7af0=_0x353f[_0x3df408];return _0x3f7af0;};'use strict';var _=require('lodash');var util=require(_0xf353('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf353('0x1'));var fs=require('fs');var Redis=require(_0xf353('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xf353('0x3'));var logger=require(_0xf353('0x4'))(_0xf353('0x5'));var config=require(_0xf353('0x6'));var jayson=require(_0xf353('0x7'));var client=jayson[_0xf353('0x8')][_0xf353('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36451b,_0x4b3fe2,_0x2e3039){return new BPromise(function(_0x846a5f,_0x3db228){return client[_0xf353('0xa')](_0x36451b,_0x2e3039)[_0xf353('0xb')](function(_0x1db56a){logger[_0xf353('0xc')](_0xf353('0xd'),_0x4b3fe2,_0xf353('0xe'));logger[_0xf353('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x4b3fe2,_0xf353('0xe'),JSON[_0xf353('0x10')](_0x1db56a));if(_0x1db56a[_0xf353('0x11')]){if(_0x1db56a['error']['code']===0x1f4){logger[_0xf353('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x4b3fe2,_0x1db56a['error'][_0xf353('0x12')]);return _0x3db228(_0x1db56a['error'][_0xf353('0x12')]);}logger[_0xf353('0x11')](_0xf353('0xd'),_0x4b3fe2,_0x1db56a[_0xf353('0x11')]['message']);return _0x846a5f(_0x1db56a[_0xf353('0x11')][_0xf353('0x12')]);}else{logger[_0xf353('0xc')](_0xf353('0xd'),_0x4b3fe2,'request\x20sent');_0x846a5f(_0x1db56a[_0xf353('0x13')][_0xf353('0x12')]);}})['catch'](function(_0x1b42bf){logger[_0xf353('0x11')](_0xf353('0xd'),_0x4b3fe2,_0x1b42bf);_0x3db228(_0x1b42bf);});});}