9c3904126b206a7c2f65801b9ca6caaabdaf8ade
[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 _0xe50a=['util','moment','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','lodash'];(function(_0x42bb0a,_0x5c713f){var _0x548011=function(_0x1532c8){while(--_0x1532c8){_0x42bb0a['push'](_0x42bb0a['shift']());}};_0x548011(++_0x5c713f);}(_0xe50a,0xb3));var _0xae50=function(_0x4d45c1,_0x2beda1){_0x4d45c1=_0x4d45c1-0x0;var _0x244478=_0xe50a[_0x4d45c1];return _0x244478;};'use strict';var _=require(_0xae50('0x0'));var util=require(_0xae50('0x1'));var moment=require(_0xae50('0x2'));var BPromise=require('bluebird');var rs=require(_0xae50('0x3'));var fs=require('fs');var Redis=require(_0xae50('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xae50('0x5'));var logger=require(_0xae50('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xae50('0x7'));var client=jayson[_0xae50('0x8')][_0xae50('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c3e7a,_0x251848,_0xf73925){return new BPromise(function(_0x30366e,_0x3a54c3){return client[_0xae50('0xa')](_0x4c3e7a,_0xf73925)[_0xae50('0xb')](function(_0x31ca72){logger[_0xae50('0xc')](_0xae50('0xd'),_0x251848,_0xae50('0xe'));logger[_0xae50('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x251848,_0xae50('0xe'),JSON[_0xae50('0x10')](_0x31ca72));if(_0x31ca72[_0xae50('0x11')]){if(_0x31ca72[_0xae50('0x11')]['code']===0x1f4){logger[_0xae50('0x11')](_0xae50('0xd'),_0x251848,_0x31ca72[_0xae50('0x11')][_0xae50('0x12')]);return _0x3a54c3(_0x31ca72[_0xae50('0x11')][_0xae50('0x12')]);}logger[_0xae50('0x11')](_0xae50('0xd'),_0x251848,_0x31ca72['error'][_0xae50('0x12')]);return _0x30366e(_0x31ca72[_0xae50('0x11')][_0xae50('0x12')]);}else{logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x251848,_0xae50('0xe'));_0x30366e(_0x31ca72['result'][_0xae50('0x12')]);}})[_0xae50('0x13')](function(_0x4a9a21){logger['error'](_0xae50('0xd'),_0x251848,_0x4a9a21);_0x3a54c3(_0x4a9a21);});});}