Built motion from commit 97153652.|2.6.26
[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 _0x7ca4=['../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','JscriptyQuestionReport,\x20%s,\x20%s','info','result','catch','lodash','util','moment','randomstring'];(function(_0x11f168,_0x36fd15){var _0x3a5e27=function(_0x3274e1){while(--_0x3274e1){_0x11f168['push'](_0x11f168['shift']());}};_0x3a5e27(++_0x36fd15);}(_0x7ca4,0x1dc));var _0x47ca=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x7ca4[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x47ca('0x0'));var util=require(_0x47ca('0x1'));var moment=require(_0x47ca('0x2'));var BPromise=require('bluebird');var rs=require(_0x47ca('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x47ca('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x47ca('0x5'));var config=require(_0x47ca('0x6'));var jayson=require(_0x47ca('0x7'));var client=jayson['client'][_0x47ca('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x13f1c6,_0x207eda,_0x5c77ff){return new BPromise(function(_0x18c32c,_0x2e01dc){return client[_0x47ca('0x9')](_0x13f1c6,_0x5c77ff)['then'](function(_0x1a13bd){logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x207eda,_0x47ca('0xa'));logger[_0x47ca('0xb')](_0x47ca('0xc'),_0x207eda,'request\x20sent',JSON[_0x47ca('0xd')](_0x1a13bd));if(_0x1a13bd[_0x47ca('0xe')]){if(_0x1a13bd['error']['code']===0x1f4){logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x207eda,_0x1a13bd[_0x47ca('0xe')][_0x47ca('0xf')]);return _0x2e01dc(_0x1a13bd['error'][_0x47ca('0xf')]);}logger[_0x47ca('0xe')](_0x47ca('0x10'),_0x207eda,_0x1a13bd['error'][_0x47ca('0xf')]);return _0x18c32c(_0x1a13bd['error'][_0x47ca('0xf')]);}else{logger[_0x47ca('0x11')](_0x47ca('0x10'),_0x207eda,'request\x20sent');_0x18c32c(_0x1a13bd[_0x47ca('0x12')][_0x47ca('0xf')]);}})[_0x47ca('0x13')](function(_0x3b2ebb){logger[_0x47ca('0xe')](_0x47ca('0x10'),_0x207eda,_0x3b2ebb);_0x2e01dc(_0x3b2ebb);});});}