Built motion from commit (unavailable).|2.0.80
[motion2.git] / server / api / jscriptyAnswerReport / jscriptyAnswerReport.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 _0xaefa=['../../config/logger','rpc','../../config/environment','client','http','then','info','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code','JscriptyAnswerReport,\x20%s,\x20%s','message','util','moment','bluebird','randomstring','../../config/utils'];(function(_0x2dd390,_0x1bc894){var _0x3afe47=function(_0x42d8d3){while(--_0x42d8d3){_0x2dd390['push'](_0x2dd390['shift']());}};_0x3afe47(++_0x1bc894);}(_0xaefa,0x151));var _0xaaef=function(_0x49b087,_0x5f15f9){_0x49b087=_0x49b087-0x0;var _0xf07237=_0xaefa[_0x49b087];return _0xf07237;};'use strict';var _=require('lodash');var util=require(_0xaaef('0x0'));var moment=require(_0xaaef('0x1'));var BPromise=require(_0xaaef('0x2'));var rs=require(_0xaaef('0x3'));var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require(_0xaaef('0x4'));var logger=require(_0xaaef('0x5'))(_0xaaef('0x6'));var config=require(_0xaaef('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xaaef('0x8')][_0xaaef('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x405795,_0x4e3c67,_0x31960e){return new BPromise(function(_0x1be067,_0x3fb24b){return client['request'](_0x405795,_0x31960e)[_0xaaef('0xa')](function(_0x1f994b){logger[_0xaaef('0xb')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x4e3c67,_0xaaef('0xc'));logger[_0xaaef('0xd')](_0xaaef('0xe'),_0x4e3c67,'request\x20sent',JSON['stringify'](_0x1f994b));if(_0x1f994b[_0xaaef('0xf')]){if(_0x1f994b['error'][_0xaaef('0x10')]===0x1f4){logger['error'](_0xaaef('0x11'),_0x4e3c67,_0x1f994b['error'][_0xaaef('0x12')]);return _0x3fb24b(_0x1f994b[_0xaaef('0xf')][_0xaaef('0x12')]);}logger[_0xaaef('0xf')](_0xaaef('0x11'),_0x4e3c67,_0x1f994b[_0xaaef('0xf')][_0xaaef('0x12')]);return _0x1be067(_0x1f994b[_0xaaef('0xf')][_0xaaef('0x12')]);}else{logger[_0xaaef('0xb')](_0xaaef('0x11'),_0x4e3c67,_0xaaef('0xc'));_0x1be067(_0x1f994b['result']['message']);}})['catch'](function(_0x6b5f40){logger['error'](_0xaaef('0x11'),_0x4e3c67,_0x6b5f40);_0x3fb24b(_0x6b5f40);});});}