Built motion from commit (unavailable).|2.5.30
[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 _0x2f89=['result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','message','info'];(function(_0x5e6bec,_0x1eb54d){var _0x5dc5cf=function(_0x59429a){while(--_0x59429a){_0x5e6bec['push'](_0x5e6bec['shift']());}};_0x5dc5cf(++_0x1eb54d);}(_0x2f89,0x95));var _0x92f8=function(_0x272365,_0x309d81){_0x272365=_0x272365-0x0;var _0x498d0e=_0x2f89[_0x272365];return _0x498d0e;};'use strict';var _=require(_0x92f8('0x0'));var util=require(_0x92f8('0x1'));var moment=require(_0x92f8('0x2'));var BPromise=require(_0x92f8('0x3'));var rs=require(_0x92f8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x92f8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x92f8('0x6'))('rpc');var config=require(_0x92f8('0x7'));var jayson=require(_0x92f8('0x8'));var client=jayson[_0x92f8('0x9')][_0x92f8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x523d93,_0x32a37f,_0x333319){return new BPromise(function(_0x4afa3c,_0x2bf789){return client[_0x92f8('0xb')](_0x523d93,_0x333319)[_0x92f8('0xc')](function(_0x1e2dba){logger['info'](_0x92f8('0xd'),_0x32a37f,_0x92f8('0xe'));logger[_0x92f8('0xf')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x32a37f,_0x92f8('0xe'),JSON['stringify'](_0x1e2dba));if(_0x1e2dba[_0x92f8('0x10')]){if(_0x1e2dba['error']['code']===0x1f4){logger[_0x92f8('0x10')](_0x92f8('0xd'),_0x32a37f,_0x1e2dba['error'][_0x92f8('0x11')]);return _0x2bf789(_0x1e2dba[_0x92f8('0x10')]['message']);}logger[_0x92f8('0x10')](_0x92f8('0xd'),_0x32a37f,_0x1e2dba[_0x92f8('0x10')]['message']);return _0x4afa3c(_0x1e2dba[_0x92f8('0x10')][_0x92f8('0x11')]);}else{logger[_0x92f8('0x12')](_0x92f8('0xd'),_0x32a37f,_0x92f8('0xe'));_0x4afa3c(_0x1e2dba[_0x92f8('0x13')][_0x92f8('0x11')]);}})[_0x92f8('0x14')](function(_0xe9e3bf){logger[_0x92f8('0x10')](_0x92f8('0xd'),_0x32a37f,_0xe9e3bf);_0x2bf789(_0xe9e3bf);});});}