Built motion from commit (unavailable).|2.0.83
[motion2.git] / server / api / analyticExtractedReport / analyticExtractedReport.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 _0x0f22=['request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s'];(function(_0x4487a2,_0x3fd5a5){var _0x4a1f33=function(_0x4f5310){while(--_0x4f5310){_0x4487a2['push'](_0x4487a2['shift']());}};_0x4a1f33(++_0x3fd5a5);}(_0x0f22,0x71));var _0x20f2=function(_0x2d4660,_0x84981e){_0x2d4660=_0x2d4660-0x0;var _0x5ef7a6=_0x0f22[_0x2d4660];return _0x5ef7a6;};'use strict';var _=require('lodash');var util=require(_0x20f2('0x0'));var moment=require(_0x20f2('0x1'));var BPromise=require(_0x20f2('0x2'));var rs=require('randomstring');var fs=require('fs');var db=require(_0x20f2('0x3'))['db'];var utils=require(_0x20f2('0x4'));var logger=require(_0x20f2('0x5'))('rpc');var config=require(_0x20f2('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x20f2('0x7')][_0x20f2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x547f6e,_0x53514b,_0x1c33b3){return new BPromise(function(_0x3d2fc0,_0x48dcf2){return client[_0x20f2('0x9')](_0x547f6e,_0x1c33b3)[_0x20f2('0xa')](function(_0x1d243a){logger[_0x20f2('0xb')](_0x20f2('0xc'),_0x53514b,_0x20f2('0xd'));logger[_0x20f2('0xe')](_0x20f2('0xf'),_0x53514b,'request\x20sent',JSON[_0x20f2('0x10')](_0x1d243a));if(_0x1d243a['error']){if(_0x1d243a['error']['code']===0x1f4){logger[_0x20f2('0x11')](_0x20f2('0xc'),_0x53514b,_0x1d243a[_0x20f2('0x11')]['message']);return _0x48dcf2(_0x1d243a[_0x20f2('0x11')][_0x20f2('0x12')]);}logger[_0x20f2('0x11')](_0x20f2('0xc'),_0x53514b,_0x1d243a[_0x20f2('0x11')]['message']);return _0x3d2fc0(_0x1d243a[_0x20f2('0x11')]['message']);}else{logger['info'](_0x20f2('0xc'),_0x53514b,_0x20f2('0xd'));_0x3d2fc0(_0x1d243a[_0x20f2('0x13')][_0x20f2('0x12')]);}})[_0x20f2('0x14')](function(_0x368aaf){logger[_0x20f2('0x11')](_0x20f2('0xc'),_0x53514b,_0x368aaf);_0x48dcf2(_0x368aaf);});});}