Built motion from commit d1eab355.|2.6.28
[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 _0xb80f=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','lodash','util','moment'];(function(_0x5ac5a1,_0x3484ad){var _0x1cb8a3=function(_0x26ecfa){while(--_0x26ecfa){_0x5ac5a1['push'](_0x5ac5a1['shift']());}};_0x1cb8a3(++_0x3484ad);}(_0xb80f,0x165));var _0xfb80=function(_0x5a22c2,_0x102745){_0x5a22c2=_0x5a22c2-0x0;var _0x317f96=_0xb80f[_0x5a22c2];return _0x317f96;};'use strict';var _=require(_0xfb80('0x0'));var util=require(_0xfb80('0x1'));var moment=require(_0xfb80('0x2'));var BPromise=require(_0xfb80('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfb80('0x4'));var db=require(_0xfb80('0x5'))['db'];var utils=require(_0xfb80('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xfb80('0x7'));var jayson=require(_0xfb80('0x8'));var client=jayson[_0xfb80('0x9')][_0xfb80('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x394670,_0x12fff7,_0x1a44d3){return new BPromise(function(_0x534e20,_0x39a16c){return client[_0xfb80('0xb')](_0x394670,_0x1a44d3)[_0xfb80('0xc')](function(_0x27c1c2){logger['info'](_0xfb80('0xd'),_0x12fff7,_0xfb80('0xe'));logger[_0xfb80('0xf')](_0xfb80('0x10'),_0x12fff7,'request\x20sent',JSON[_0xfb80('0x11')](_0x27c1c2));if(_0x27c1c2['error']){if(_0x27c1c2['error'][_0xfb80('0x12')]===0x1f4){logger[_0xfb80('0x13')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x12fff7,_0x27c1c2[_0xfb80('0x13')][_0xfb80('0x14')]);return _0x39a16c(_0x27c1c2[_0xfb80('0x13')][_0xfb80('0x14')]);}logger[_0xfb80('0x13')](_0xfb80('0xd'),_0x12fff7,_0x27c1c2[_0xfb80('0x13')][_0xfb80('0x14')]);return _0x534e20(_0x27c1c2[_0xfb80('0x13')][_0xfb80('0x14')]);}else{logger[_0xfb80('0x15')](_0xfb80('0xd'),_0x12fff7,'request\x20sent');_0x534e20(_0x27c1c2[_0xfb80('0x16')][_0xfb80('0x14')]);}})[_0xfb80('0x17')](function(_0x383b2f){logger['error'](_0xfb80('0xd'),_0x12fff7,_0x383b2f);_0x39a16c(_0x383b2f);});});}