Built motion from commit 25580385.|2.6.2
[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 _0xe492=['error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','JscriptyQuestionReport,\x20%s,\x20%s','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x5c107c,_0x17aa85){var _0x2b496f=function(_0x4d14c4){while(--_0x4d14c4){_0x5c107c['push'](_0x5c107c['shift']());}};_0x2b496f(++_0x17aa85);}(_0xe492,0x130));var _0x2e49=function(_0x80d21a,_0x26fc3b){_0x80d21a=_0x80d21a-0x0;var _0x239369=_0xe492[_0x80d21a];return _0x239369;};'use strict';var _=require(_0x2e49('0x0'));var util=require(_0x2e49('0x1'));var moment=require(_0x2e49('0x2'));var BPromise=require(_0x2e49('0x3'));var rs=require(_0x2e49('0x4'));var fs=require('fs');var Redis=require(_0x2e49('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2e49('0x6'));var logger=require(_0x2e49('0x7'))(_0x2e49('0x8'));var config=require(_0x2e49('0x9'));var jayson=require(_0x2e49('0xa'));var client=jayson[_0x2e49('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f78ca,_0xb5480e,_0x49b845){return new BPromise(function(_0x19c1b2,_0x43389b){return client[_0x2e49('0xc')](_0x4f78ca,_0x49b845)[_0x2e49('0xd')](function(_0x11746d){logger['info'](_0x2e49('0xe'),_0xb5480e,'request\x20sent');logger[_0x2e49('0xf')](_0x2e49('0x10'),_0xb5480e,_0x2e49('0x11'),JSON['stringify'](_0x11746d));if(_0x11746d[_0x2e49('0x12')]){if(_0x11746d[_0x2e49('0x12')][_0x2e49('0x13')]===0x1f4){logger[_0x2e49('0x12')](_0x2e49('0xe'),_0xb5480e,_0x11746d[_0x2e49('0x12')][_0x2e49('0x14')]);return _0x43389b(_0x11746d[_0x2e49('0x12')]['message']);}logger['error'](_0x2e49('0xe'),_0xb5480e,_0x11746d['error'][_0x2e49('0x14')]);return _0x19c1b2(_0x11746d['error']['message']);}else{logger[_0x2e49('0x15')](_0x2e49('0xe'),_0xb5480e,_0x2e49('0x11'));_0x19c1b2(_0x11746d['result'][_0x2e49('0x14')]);}})[_0x2e49('0x16')](function(_0x862875){logger[_0x2e49('0x12')](_0x2e49('0xe'),_0xb5480e,_0x862875);_0x43389b(_0x862875);});});}