37c072d5b999676db4d2d36435119ee93c552d6b
[motion2.git] / server / api / chatTransferReport / chatTransferReport.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 _0xdb03=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','message','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x546a30,_0x4124c3){var _0x544bff=function(_0x116621){while(--_0x116621){_0x546a30['push'](_0x546a30['shift']());}};_0x544bff(++_0x4124c3);}(_0xdb03,0x174));var _0x3db0=function(_0x1cfcbd,_0x4a7590){_0x1cfcbd=_0x1cfcbd-0x0;var _0x386eb1=_0xdb03[_0x1cfcbd];return _0x386eb1;};'use strict';var _=require(_0x3db0('0x0'));var util=require(_0x3db0('0x1'));var moment=require(_0x3db0('0x2'));var BPromise=require(_0x3db0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3db0('0x4'));var db=require(_0x3db0('0x5'))['db'];var utils=require(_0x3db0('0x6'));var logger=require(_0x3db0('0x7'))(_0x3db0('0x8'));var config=require(_0x3db0('0x9'));var jayson=require(_0x3db0('0xa'));var client=jayson[_0x3db0('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2dd7f4,_0x39954d,_0x1aa90c){return new BPromise(function(_0x5bd066,_0x576a72){return client[_0x3db0('0xc')](_0x2dd7f4,_0x1aa90c)[_0x3db0('0xd')](function(_0x33a5ad){logger[_0x3db0('0xe')](_0x3db0('0xf'),_0x39954d,_0x3db0('0x10'));logger[_0x3db0('0x11')](_0x3db0('0x12'),_0x39954d,_0x3db0('0x10'),JSON['stringify'](_0x33a5ad));if(_0x33a5ad[_0x3db0('0x13')]){if(_0x33a5ad[_0x3db0('0x13')]['code']===0x1f4){logger[_0x3db0('0x13')](_0x3db0('0xf'),_0x39954d,_0x33a5ad[_0x3db0('0x13')][_0x3db0('0x14')]);return _0x576a72(_0x33a5ad[_0x3db0('0x13')]['message']);}logger[_0x3db0('0x13')](_0x3db0('0xf'),_0x39954d,_0x33a5ad[_0x3db0('0x13')][_0x3db0('0x14')]);return _0x5bd066(_0x33a5ad['error']['message']);}else{logger['info'](_0x3db0('0xf'),_0x39954d,'request\x20sent');_0x5bd066(_0x33a5ad['result'][_0x3db0('0x14')]);}})['catch'](function(_0x59f746){logger[_0x3db0('0x13')](_0x3db0('0xf'),_0x39954d,_0x59f746);_0x576a72(_0x59f746);});});}