41e8a33259efdf6dba59d3bf73b14bcea08d3937
[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 _0xd554=['info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x48edc3,_0x3776e4){var _0xfd73d1=function(_0x440552){while(--_0x440552){_0x48edc3['push'](_0x48edc3['shift']());}};_0xfd73d1(++_0x3776e4);}(_0xd554,0x105));var _0x4d55=function(_0xdf161e,_0x3884be){_0xdf161e=_0xdf161e-0x0;var _0x1373cc=_0xd554[_0xdf161e];return _0x1373cc;};'use strict';var _=require(_0x4d55('0x0'));var util=require(_0x4d55('0x1'));var moment=require(_0x4d55('0x2'));var BPromise=require('bluebird');var rs=require(_0x4d55('0x3'));var fs=require('fs');var Redis=require(_0x4d55('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4d55('0x5'));var logger=require('../../config/logger')(_0x4d55('0x6'));var config=require(_0x4d55('0x7'));var jayson=require(_0x4d55('0x8'));var client=jayson[_0x4d55('0x9')][_0x4d55('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x14bcbc,_0x45674f,_0x453618){return new BPromise(function(_0x133184,_0x2af58f){return client['request'](_0x14bcbc,_0x453618)[_0x4d55('0xb')](function(_0x50327c){logger[_0x4d55('0xc')](_0x4d55('0xd'),_0x45674f,_0x4d55('0xe'));logger[_0x4d55('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x45674f,_0x4d55('0xe'),JSON[_0x4d55('0x10')](_0x50327c));if(_0x50327c['error']){if(_0x50327c[_0x4d55('0x11')][_0x4d55('0x12')]===0x1f4){logger[_0x4d55('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x45674f,_0x50327c[_0x4d55('0x11')]['message']);return _0x2af58f(_0x50327c['error'][_0x4d55('0x13')]);}logger[_0x4d55('0x11')](_0x4d55('0xd'),_0x45674f,_0x50327c['error'][_0x4d55('0x13')]);return _0x133184(_0x50327c[_0x4d55('0x11')][_0x4d55('0x13')]);}else{logger['info'](_0x4d55('0xd'),_0x45674f,_0x4d55('0xe'));_0x133184(_0x50327c[_0x4d55('0x14')][_0x4d55('0x13')]);}})['catch'](function(_0x44dd7d){logger[_0x4d55('0x11')](_0x4d55('0xd'),_0x45674f,_0x44dd7d);_0x2af58f(_0x44dd7d);});});}