Built motion from commit 85328c08.|2.5.50
[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 _0x2960=['info','request\x20sent','stringify','error','JscriptyQuestionReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x3c7bb0,_0x1a9fc2){var _0x3944a4=function(_0x3f68fc){while(--_0x3f68fc){_0x3c7bb0['push'](_0x3c7bb0['shift']());}};_0x3944a4(++_0x1a9fc2);}(_0x2960,0xe4));var _0x0296=function(_0x35ec01,_0x5c44ac){_0x35ec01=_0x35ec01-0x0;var _0x4f75d5=_0x2960[_0x35ec01];return _0x4f75d5;};'use strict';var _=require(_0x0296('0x0'));var util=require(_0x0296('0x1'));var moment=require(_0x0296('0x2'));var BPromise=require(_0x0296('0x3'));var rs=require(_0x0296('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0296('0x5'))['db'];var utils=require(_0x0296('0x6'));var logger=require('../../config/logger')(_0x0296('0x7'));var config=require(_0x0296('0x8'));var jayson=require(_0x0296('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x6be7c1,_0x10ef7b,_0x2919d6){return new BPromise(function(_0x204fdb,_0x30fd81){return client[_0x0296('0xa')](_0x6be7c1,_0x2919d6)[_0x0296('0xb')](function(_0x57d7bf){logger[_0x0296('0xc')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x10ef7b,_0x0296('0xd'));logger['debug']('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x10ef7b,'request\x20sent',JSON[_0x0296('0xe')](_0x57d7bf));if(_0x57d7bf['error']){if(_0x57d7bf[_0x0296('0xf')]['code']===0x1f4){logger[_0x0296('0xf')](_0x0296('0x10'),_0x10ef7b,_0x57d7bf[_0x0296('0xf')][_0x0296('0x11')]);return _0x30fd81(_0x57d7bf['error'][_0x0296('0x11')]);}logger[_0x0296('0xf')](_0x0296('0x10'),_0x10ef7b,_0x57d7bf[_0x0296('0xf')][_0x0296('0x11')]);return _0x204fdb(_0x57d7bf[_0x0296('0xf')]['message']);}else{logger[_0x0296('0xc')](_0x0296('0x10'),_0x10ef7b,_0x0296('0xd'));_0x204fdb(_0x57d7bf[_0x0296('0x12')]['message']);}})[_0x0296('0x13')](function(_0x38ea9f){logger[_0x0296('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x10ef7b,_0x38ea9f);_0x30fd81(_0x38ea9f);});});}