Built motion from commit 5b761a7b.|2.5.36
[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 _0xe34f=['../../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','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x47a5e9,_0xe3c62c){var _0x31fc68=function(_0x3c2748){while(--_0x3c2748){_0x47a5e9['push'](_0x47a5e9['shift']());}};_0x31fc68(++_0xe3c62c);}(_0xe34f,0x1a6));var _0xfe34=function(_0x49d9d6,_0x1cbc03){_0x49d9d6=_0x49d9d6-0x0;var _0x54e88b=_0xe34f[_0x49d9d6];return _0x54e88b;};'use strict';var _=require(_0xfe34('0x0'));var util=require(_0xfe34('0x1'));var moment=require(_0xfe34('0x2'));var BPromise=require(_0xfe34('0x3'));var rs=require(_0xfe34('0x4'));var fs=require('fs');var Redis=require(_0xfe34('0x5'));var db=require(_0xfe34('0x6'))['db'];var utils=require(_0xfe34('0x7'));var logger=require(_0xfe34('0x8'))(_0xfe34('0x9'));var config=require(_0xfe34('0xa'));var jayson=require(_0xfe34('0xb'));var client=jayson[_0xfe34('0xc')][_0xfe34('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1344fa,_0x5b8502,_0x4ccba8){return new BPromise(function(_0x4a742c,_0x32f76a){return client[_0xfe34('0xe')](_0x1344fa,_0x4ccba8)[_0xfe34('0xf')](function(_0x4cc4d0){logger['info'](_0xfe34('0x10'),_0x5b8502,_0xfe34('0x11'));logger[_0xfe34('0x12')](_0xfe34('0x13'),_0x5b8502,'request\x20sent',JSON[_0xfe34('0x14')](_0x4cc4d0));if(_0x4cc4d0['error']){if(_0x4cc4d0[_0xfe34('0x15')][_0xfe34('0x16')]===0x1f4){logger['error'](_0xfe34('0x10'),_0x5b8502,_0x4cc4d0['error'][_0xfe34('0x17')]);return _0x32f76a(_0x4cc4d0[_0xfe34('0x15')][_0xfe34('0x17')]);}logger['error'](_0xfe34('0x10'),_0x5b8502,_0x4cc4d0['error'][_0xfe34('0x17')]);return _0x4a742c(_0x4cc4d0[_0xfe34('0x15')]['message']);}else{logger[_0xfe34('0x18')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x5b8502,_0xfe34('0x11'));_0x4a742c(_0x4cc4d0[_0xfe34('0x19')][_0xfe34('0x17')]);}})[_0xfe34('0x1a')](function(_0x174928){logger['error'](_0xfe34('0x10'),_0x5b8502,_0x174928);_0x32f76a(_0x174928);});});}