Built motion from commit (unavailable).|2.5.14
[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 _0xf4f4=['JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xf4f4,0x160));var _0x4f4f=function(_0x497571,_0x3c0386){_0x497571=_0x497571-0x0;var _0x579c0b=_0xf4f4[_0x497571];return _0x579c0b;};'use strict';var _=require('lodash');var util=require(_0x4f4f('0x0'));var moment=require(_0x4f4f('0x1'));var BPromise=require('bluebird');var rs=require(_0x4f4f('0x2'));var fs=require('fs');var Redis=require(_0x4f4f('0x3'));var db=require(_0x4f4f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4f4f('0x5'))(_0x4f4f('0x6'));var config=require(_0x4f4f('0x7'));var jayson=require(_0x4f4f('0x8'));var client=jayson[_0x4f4f('0x9')][_0x4f4f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x39bf00,_0x1a333a,_0x2d598a){return new BPromise(function(_0x93a84c,_0x355845){return client[_0x4f4f('0xb')](_0x39bf00,_0x2d598a)[_0x4f4f('0xc')](function(_0xf1aaee){logger[_0x4f4f('0xd')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x1a333a,_0x4f4f('0xe'));logger[_0x4f4f('0xf')](_0x4f4f('0x10'),_0x1a333a,_0x4f4f('0xe'),JSON[_0x4f4f('0x11')](_0xf1aaee));if(_0xf1aaee[_0x4f4f('0x12')]){if(_0xf1aaee['error'][_0x4f4f('0x13')]===0x1f4){logger[_0x4f4f('0x12')](_0x4f4f('0x14'),_0x1a333a,_0xf1aaee['error'][_0x4f4f('0x15')]);return _0x355845(_0xf1aaee[_0x4f4f('0x12')][_0x4f4f('0x15')]);}logger[_0x4f4f('0x12')](_0x4f4f('0x14'),_0x1a333a,_0xf1aaee['error'][_0x4f4f('0x15')]);return _0x93a84c(_0xf1aaee[_0x4f4f('0x12')][_0x4f4f('0x15')]);}else{logger[_0x4f4f('0xd')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x1a333a,_0x4f4f('0xe'));_0x93a84c(_0xf1aaee['result'][_0x4f4f('0x15')]);}})[_0x4f4f('0x16')](function(_0xbab07b){logger[_0x4f4f('0x12')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x1a333a,_0xbab07b);_0x355845(_0xbab07b);});});}