4add27c4d412de34340598d607ea126009f89302
[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 _0x1b52=['../../config/logger','rpc','../../config/environment','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x1b52,0xec));var _0x21b5=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x1b52[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require(_0x21b5('0x0'));var util=require(_0x21b5('0x1'));var moment=require('moment');var BPromise=require(_0x21b5('0x2'));var rs=require(_0x21b5('0x3'));var fs=require('fs');var Redis=require(_0x21b5('0x4'));var db=require(_0x21b5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x21b5('0x6'))(_0x21b5('0x7'));var config=require(_0x21b5('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x21b5('0x9')][_0x21b5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37ffe1,_0x3bc3b7,_0xe7b738){return new BPromise(function(_0x1c2939,_0x4c9e84){return client[_0x21b5('0xb')](_0x37ffe1,_0xe7b738)[_0x21b5('0xc')](function(_0x256a74){logger[_0x21b5('0xd')](_0x21b5('0xe'),_0x3bc3b7,_0x21b5('0xf'));logger[_0x21b5('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x3bc3b7,_0x21b5('0xf'),JSON[_0x21b5('0x11')](_0x256a74));if(_0x256a74['error']){if(_0x256a74['error'][_0x21b5('0x12')]===0x1f4){logger[_0x21b5('0x13')](_0x21b5('0xe'),_0x3bc3b7,_0x256a74[_0x21b5('0x13')][_0x21b5('0x14')]);return _0x4c9e84(_0x256a74[_0x21b5('0x13')][_0x21b5('0x14')]);}logger[_0x21b5('0x13')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x3bc3b7,_0x256a74[_0x21b5('0x13')]['message']);return _0x1c2939(_0x256a74[_0x21b5('0x13')][_0x21b5('0x14')]);}else{logger['info'](_0x21b5('0xe'),_0x3bc3b7,_0x21b5('0xf'));_0x1c2939(_0x256a74[_0x21b5('0x15')][_0x21b5('0x14')]);}})['catch'](function(_0x456d64){logger['error'](_0x21b5('0xe'),_0x3bc3b7,_0x456d64);_0x4c9e84(_0x456d64);});});}