64b109b5df0d36709a85456b9321ddc1f3ae09de
[motion2.git] / server / api / analyticCustomReport / analyticCustomReport.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 _0x25fa=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','AnalyticCustomReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x36a560,_0x57378b){var _0x10923a=function(_0xd1fa18){while(--_0xd1fa18){_0x36a560['push'](_0x36a560['shift']());}};_0x10923a(++_0x57378b);}(_0x25fa,0xdb));var _0xa25f=function(_0x27c5ad,_0x3c5cce){_0x27c5ad=_0x27c5ad-0x0;var _0x3cb7af=_0x25fa[_0x27c5ad];return _0x3cb7af;};'use strict';var _=require(_0xa25f('0x0'));var util=require(_0xa25f('0x1'));var moment=require(_0xa25f('0x2'));var BPromise=require(_0xa25f('0x3'));var rs=require(_0xa25f('0x4'));var fs=require('fs');var Redis=require(_0xa25f('0x5'));var db=require(_0xa25f('0x6'))['db'];var utils=require(_0xa25f('0x7'));var logger=require('../../config/logger')(_0xa25f('0x8'));var config=require(_0xa25f('0x9'));var jayson=require(_0xa25f('0xa'));var client=jayson[_0xa25f('0xb')][_0xa25f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x430151,_0x26f7fd,_0x4d52e3){return new BPromise(function(_0x1f8dde,_0xa0100c){return client[_0xa25f('0xd')](_0x430151,_0x4d52e3)[_0xa25f('0xe')](function(_0x38c5a0){logger[_0xa25f('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x26f7fd,_0xa25f('0x10'));logger[_0xa25f('0x11')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x26f7fd,_0xa25f('0x10'),JSON[_0xa25f('0x12')](_0x38c5a0));if(_0x38c5a0[_0xa25f('0x13')]){if(_0x38c5a0[_0xa25f('0x13')][_0xa25f('0x14')]===0x1f4){logger[_0xa25f('0x13')](_0xa25f('0x15'),_0x26f7fd,_0x38c5a0[_0xa25f('0x13')]['message']);return _0xa0100c(_0x38c5a0['error'][_0xa25f('0x16')]);}logger[_0xa25f('0x13')](_0xa25f('0x15'),_0x26f7fd,_0x38c5a0[_0xa25f('0x13')]['message']);return _0x1f8dde(_0x38c5a0['error'][_0xa25f('0x16')]);}else{logger[_0xa25f('0xf')](_0xa25f('0x15'),_0x26f7fd,_0xa25f('0x10'));_0x1f8dde(_0x38c5a0[_0xa25f('0x17')][_0xa25f('0x16')]);}})[_0xa25f('0x18')](function(_0xa9869f){logger[_0xa25f('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0x26f7fd,_0xa9869f);_0xa0100c(_0xa9869f);});});}