Built motion from commit e6806ed6.|2.6.0
[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 _0xf2b3=['result','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message'];(function(_0x207b44,_0x390c86){var _0xca66ec=function(_0x3d5105){while(--_0x3d5105){_0x207b44['push'](_0x207b44['shift']());}};_0xca66ec(++_0x390c86);}(_0xf2b3,0xfd));var _0x3f2b=function(_0xa37a6f,_0x3f25c2){_0xa37a6f=_0xa37a6f-0x0;var _0xa304ad=_0xf2b3[_0xa37a6f];return _0xa304ad;};'use strict';var _=require(_0x3f2b('0x0'));var util=require(_0x3f2b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3f2b('0x2'));var fs=require('fs');var Redis=require(_0x3f2b('0x3'));var db=require(_0x3f2b('0x4'))['db'];var utils=require(_0x3f2b('0x5'));var logger=require('../../config/logger')(_0x3f2b('0x6'));var config=require(_0x3f2b('0x7'));var jayson=require(_0x3f2b('0x8'));var client=jayson[_0x3f2b('0x9')][_0x3f2b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1858c4,_0x1f5ec9,_0x44fcb4){return new BPromise(function(_0x3405f6,_0x11ab89){return client['request'](_0x1858c4,_0x44fcb4)[_0x3f2b('0xb')](function(_0x4c99b7){logger[_0x3f2b('0xc')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x1f5ec9,_0x3f2b('0xd'));logger[_0x3f2b('0xe')](_0x3f2b('0xf'),_0x1f5ec9,'request\x20sent',JSON['stringify'](_0x4c99b7));if(_0x4c99b7[_0x3f2b('0x10')]){if(_0x4c99b7['error'][_0x3f2b('0x11')]===0x1f4){logger['error'](_0x3f2b('0x12'),_0x1f5ec9,_0x4c99b7[_0x3f2b('0x10')][_0x3f2b('0x13')]);return _0x11ab89(_0x4c99b7[_0x3f2b('0x10')]['message']);}logger[_0x3f2b('0x10')](_0x3f2b('0x12'),_0x1f5ec9,_0x4c99b7[_0x3f2b('0x10')][_0x3f2b('0x13')]);return _0x3405f6(_0x4c99b7[_0x3f2b('0x10')]['message']);}else{logger[_0x3f2b('0xc')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x1f5ec9,'request\x20sent');_0x3405f6(_0x4c99b7[_0x3f2b('0x14')][_0x3f2b('0x13')]);}})['catch'](function(_0x4f55cc){logger['error'](_0x3f2b('0x12'),_0x1f5ec9,_0x4f55cc);_0x11ab89(_0x4f55cc);});});}