c4a371e62b97509517b8665c720b859987415922
[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 _0x9040=['JscriptyQuestionReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','error','code'];(function(_0x145690,_0x216725){var _0x4e66cf=function(_0x2f2cd7){while(--_0x2f2cd7){_0x145690['push'](_0x145690['shift']());}};_0x4e66cf(++_0x216725);}(_0x9040,0x12a));var _0x0904=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x9040[_0x580576];return _0x3f55a0;};'use strict';var _=require(_0x0904('0x0'));var util=require(_0x0904('0x1'));var moment=require(_0x0904('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0904('0x3'));var db=require(_0x0904('0x4'))['db'];var utils=require(_0x0904('0x5'));var logger=require(_0x0904('0x6'))(_0x0904('0x7'));var config=require(_0x0904('0x8'));var jayson=require(_0x0904('0x9'));var client=jayson[_0x0904('0xa')][_0x0904('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x30f2b4,_0x2fdb84,_0x2e5797){return new BPromise(function(_0x43b06a,_0x6518b4){return client['request'](_0x30f2b4,_0x2e5797)[_0x0904('0xc')](function(_0x149d43){logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x2fdb84,_0x0904('0xd'));logger[_0x0904('0xe')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x2fdb84,_0x0904('0xd'),JSON['stringify'](_0x149d43));if(_0x149d43[_0x0904('0xf')]){if(_0x149d43[_0x0904('0xf')][_0x0904('0x10')]===0x1f4){logger[_0x0904('0xf')](_0x0904('0x11'),_0x2fdb84,_0x149d43[_0x0904('0xf')][_0x0904('0x12')]);return _0x6518b4(_0x149d43[_0x0904('0xf')][_0x0904('0x12')]);}logger['error'](_0x0904('0x11'),_0x2fdb84,_0x149d43[_0x0904('0xf')]['message']);return _0x43b06a(_0x149d43[_0x0904('0xf')][_0x0904('0x12')]);}else{logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x2fdb84,_0x0904('0xd'));_0x43b06a(_0x149d43[_0x0904('0x13')]['message']);}})[_0x0904('0x14')](function(_0x5803a8){logger[_0x0904('0xf')](_0x0904('0x11'),_0x2fdb84,_0x5803a8);_0x6518b4(_0x5803a8);});});}