Built motion from commit f7863d46.|2.5.41
[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 _0x00be=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x31b5b2,_0x5ab927){var _0x364f13=function(_0x163bd0){while(--_0x163bd0){_0x31b5b2['push'](_0x31b5b2['shift']());}};_0x364f13(++_0x5ab927);}(_0x00be,0x1a8));var _0xe00b=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x00be[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xe00b('0x0'));var util=require('util');var moment=require(_0xe00b('0x1'));var BPromise=require(_0xe00b('0x2'));var rs=require(_0xe00b('0x3'));var fs=require('fs');var Redis=require(_0xe00b('0x4'));var db=require(_0xe00b('0x5'))['db'];var utils=require(_0xe00b('0x6'));var logger=require(_0xe00b('0x7'))(_0xe00b('0x8'));var config=require(_0xe00b('0x9'));var jayson=require(_0xe00b('0xa'));var client=jayson[_0xe00b('0xb')][_0xe00b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x192169,_0x4053ba,_0x403120){return new BPromise(function(_0x45bb26,_0x348f21){return client[_0xe00b('0xd')](_0x192169,_0x403120)[_0xe00b('0xe')](function(_0x23524d){logger[_0xe00b('0xf')](_0xe00b('0x10'),_0x4053ba,_0xe00b('0x11'));logger[_0xe00b('0x12')](_0xe00b('0x13'),_0x4053ba,'request\x20sent',JSON['stringify'](_0x23524d));if(_0x23524d[_0xe00b('0x14')]){if(_0x23524d[_0xe00b('0x14')][_0xe00b('0x15')]===0x1f4){logger[_0xe00b('0x14')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x4053ba,_0x23524d[_0xe00b('0x14')][_0xe00b('0x16')]);return _0x348f21(_0x23524d[_0xe00b('0x14')][_0xe00b('0x16')]);}logger[_0xe00b('0x14')](_0xe00b('0x10'),_0x4053ba,_0x23524d[_0xe00b('0x14')]['message']);return _0x45bb26(_0x23524d[_0xe00b('0x14')][_0xe00b('0x16')]);}else{logger[_0xe00b('0xf')](_0xe00b('0x10'),_0x4053ba,_0xe00b('0x11'));_0x45bb26(_0x23524d[_0xe00b('0x17')][_0xe00b('0x16')]);}})[_0xe00b('0x18')](function(_0x1599cb){logger[_0xe00b('0x14')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x4053ba,_0x1599cb);_0x348f21(_0x1599cb);});});}