Built motion from commit 20b39a97.|2.6.29
[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 _0x4a57=['randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x4a57,0xcb));var _0x74a5=function(_0x23402b,_0x421ac9){_0x23402b=_0x23402b-0x0;var _0x3a21c7=_0x4a57[_0x23402b];return _0x3a21c7;};'use strict';var _=require(_0x74a5('0x0'));var util=require(_0x74a5('0x1'));var moment=require(_0x74a5('0x2'));var BPromise=require(_0x74a5('0x3'));var rs=require(_0x74a5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x74a5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x74a5('0x6'))('rpc');var config=require(_0x74a5('0x7'));var jayson=require(_0x74a5('0x8'));var client=jayson[_0x74a5('0x9')][_0x74a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x92d3f4,_0x315b49,_0x55672f){return new BPromise(function(_0x3e3f3c,_0x2fd5b5){return client[_0x74a5('0xb')](_0x92d3f4,_0x55672f)[_0x74a5('0xc')](function(_0x1669fe){logger['info'](_0x74a5('0xd'),_0x315b49,_0x74a5('0xe'));logger[_0x74a5('0xf')](_0x74a5('0x10'),_0x315b49,_0x74a5('0xe'),JSON[_0x74a5('0x11')](_0x1669fe));if(_0x1669fe[_0x74a5('0x12')]){if(_0x1669fe[_0x74a5('0x12')][_0x74a5('0x13')]===0x1f4){logger[_0x74a5('0x12')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x315b49,_0x1669fe['error'][_0x74a5('0x14')]);return _0x2fd5b5(_0x1669fe[_0x74a5('0x12')][_0x74a5('0x14')]);}logger[_0x74a5('0x12')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x315b49,_0x1669fe[_0x74a5('0x12')][_0x74a5('0x14')]);return _0x3e3f3c(_0x1669fe[_0x74a5('0x12')][_0x74a5('0x14')]);}else{logger[_0x74a5('0x15')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x315b49,'request\x20sent');_0x3e3f3c(_0x1669fe['result']['message']);}})[_0x74a5('0x16')](function(_0x289a2f){logger['error'](_0x74a5('0xd'),_0x315b49,_0x289a2f);_0x2fd5b5(_0x289a2f);});});}