Built motion from commit f3da74b7.|2.5.36
[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 _0x74fd=['client','http','then','info','JscriptyQuestionReport,\x20%s,\x20%s','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x170902,_0x1627d5){var _0x1a2ff3=function(_0x5181ea){while(--_0x5181ea){_0x170902['push'](_0x170902['shift']());}};_0x1a2ff3(++_0x1627d5);}(_0x74fd,0x116));var _0xd74f=function(_0x104e21,_0x2ea86f){_0x104e21=_0x104e21-0x0;var _0x605b37=_0x74fd[_0x104e21];return _0x605b37;};'use strict';var _=require(_0xd74f('0x0'));var util=require(_0xd74f('0x1'));var moment=require(_0xd74f('0x2'));var BPromise=require('bluebird');var rs=require(_0xd74f('0x3'));var fs=require('fs');var Redis=require(_0xd74f('0x4'));var db=require(_0xd74f('0x5'))['db'];var utils=require(_0xd74f('0x6'));var logger=require(_0xd74f('0x7'))(_0xd74f('0x8'));var config=require(_0xd74f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd74f('0xa')][_0xd74f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1c9b57,_0x1a2984,_0x2ecbd5){return new BPromise(function(_0x2f63e2,_0x539ccc){return client['request'](_0x1c9b57,_0x2ecbd5)[_0xd74f('0xc')](function(_0x38037d){logger[_0xd74f('0xd')](_0xd74f('0xe'),_0x1a2984,'request\x20sent');logger[_0xd74f('0xf')](_0xd74f('0x10'),_0x1a2984,_0xd74f('0x11'),JSON[_0xd74f('0x12')](_0x38037d));if(_0x38037d[_0xd74f('0x13')]){if(_0x38037d[_0xd74f('0x13')][_0xd74f('0x14')]===0x1f4){logger[_0xd74f('0x13')](_0xd74f('0xe'),_0x1a2984,_0x38037d['error']['message']);return _0x539ccc(_0x38037d[_0xd74f('0x13')][_0xd74f('0x15')]);}logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x1a2984,_0x38037d[_0xd74f('0x13')][_0xd74f('0x15')]);return _0x2f63e2(_0x38037d[_0xd74f('0x13')]['message']);}else{logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x1a2984,_0xd74f('0x11'));_0x2f63e2(_0x38037d[_0xd74f('0x16')][_0xd74f('0x15')]);}})[_0xd74f('0x17')](function(_0x31ec5c){logger['error'](_0xd74f('0xe'),_0x1a2984,_0x31ec5c);_0x539ccc(_0x31ec5c);});});}