Built motion from commit (unavailable).|2.5.29
[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 _0x9ae6=['http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x26d6d9,_0x431cb8){var _0x1b4875=function(_0x41111f){while(--_0x41111f){_0x26d6d9['push'](_0x26d6d9['shift']());}};_0x1b4875(++_0x431cb8);}(_0x9ae6,0xe6));var _0x69ae=function(_0x15d285,_0x5b85ef){_0x15d285=_0x15d285-0x0;var _0x6d556d=_0x9ae6[_0x15d285];return _0x6d556d;};'use strict';var _=require(_0x69ae('0x0'));var util=require('util');var moment=require(_0x69ae('0x1'));var BPromise=require(_0x69ae('0x2'));var rs=require(_0x69ae('0x3'));var fs=require('fs');var Redis=require(_0x69ae('0x4'));var db=require(_0x69ae('0x5'))['db'];var utils=require(_0x69ae('0x6'));var logger=require(_0x69ae('0x7'))(_0x69ae('0x8'));var config=require(_0x69ae('0x9'));var jayson=require(_0x69ae('0xa'));var client=jayson[_0x69ae('0xb')][_0x69ae('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x32256,_0x5471d0,_0x131b21){return new BPromise(function(_0xbc09d9,_0x30a021){return client[_0x69ae('0xd')](_0x32256,_0x131b21)[_0x69ae('0xe')](function(_0x322338){logger['info'](_0x69ae('0xf'),_0x5471d0,_0x69ae('0x10'));logger['debug'](_0x69ae('0x11'),_0x5471d0,'request\x20sent',JSON[_0x69ae('0x12')](_0x322338));if(_0x322338[_0x69ae('0x13')]){if(_0x322338[_0x69ae('0x13')]['code']===0x1f4){logger['error'](_0x69ae('0xf'),_0x5471d0,_0x322338[_0x69ae('0x13')][_0x69ae('0x14')]);return _0x30a021(_0x322338[_0x69ae('0x13')][_0x69ae('0x14')]);}logger[_0x69ae('0x13')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x5471d0,_0x322338[_0x69ae('0x13')][_0x69ae('0x14')]);return _0xbc09d9(_0x322338[_0x69ae('0x13')][_0x69ae('0x14')]);}else{logger['info'](_0x69ae('0xf'),_0x5471d0,_0x69ae('0x10'));_0xbc09d9(_0x322338['result']['message']);}})[_0x69ae('0x15')](function(_0xdb2e14){logger['error'](_0x69ae('0xf'),_0x5471d0,_0xdb2e14);_0x30a021(_0xdb2e14);});});}