3f264a503e43747643b1f7e3bbb3fc468737b82e
[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 _0x0628=['rpc','../../config/environment','client','http','request','info','request\x20sent','debug','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4d4017,_0x51ad84){var _0x14ecb2=function(_0xdfce47){while(--_0xdfce47){_0x4d4017['push'](_0x4d4017['shift']());}};_0x14ecb2(++_0x51ad84);}(_0x0628,0x11f));var _0x8062=function(_0x3e830c,_0x4cd9b0){_0x3e830c=_0x3e830c-0x0;var _0x448c62=_0x0628[_0x3e830c];return _0x448c62;};'use strict';var _=require(_0x8062('0x0'));var util=require(_0x8062('0x1'));var moment=require(_0x8062('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8062('0x3'));var db=require(_0x8062('0x4'))['db'];var utils=require(_0x8062('0x5'));var logger=require(_0x8062('0x6'))(_0x8062('0x7'));var config=require(_0x8062('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8062('0x9')][_0x8062('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x45861b,_0x16bc6c,_0x1e90c3){return new BPromise(function(_0x581f19,_0xff6907){return client[_0x8062('0xb')](_0x45861b,_0x1e90c3)['then'](function(_0x303c8b){logger[_0x8062('0xc')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x16bc6c,_0x8062('0xd'));logger[_0x8062('0xe')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x16bc6c,_0x8062('0xd'),JSON['stringify'](_0x303c8b));if(_0x303c8b[_0x8062('0xf')]){if(_0x303c8b[_0x8062('0xf')][_0x8062('0x10')]===0x1f4){logger[_0x8062('0xf')](_0x8062('0x11'),_0x16bc6c,_0x303c8b['error']['message']);return _0xff6907(_0x303c8b[_0x8062('0xf')][_0x8062('0x12')]);}logger[_0x8062('0xf')](_0x8062('0x11'),_0x16bc6c,_0x303c8b[_0x8062('0xf')]['message']);return _0x581f19(_0x303c8b[_0x8062('0xf')][_0x8062('0x12')]);}else{logger[_0x8062('0xc')](_0x8062('0x11'),_0x16bc6c,_0x8062('0xd'));_0x581f19(_0x303c8b[_0x8062('0x13')][_0x8062('0x12')]);}})[_0x8062('0x14')](function(_0x20bbbd){logger[_0x8062('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x16bc6c,_0x20bbbd);_0xff6907(_0x20bbbd);});});}