0926b189e8763de266fb590c3e415d522d26a5aa
[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 _0xb835=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','ChatTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x6d6a66,_0x2924af){var _0x11eb6e=function(_0x52e55a){while(--_0x52e55a){_0x6d6a66['push'](_0x6d6a66['shift']());}};_0x11eb6e(++_0x2924af);}(_0xb835,0xb0));var _0x5b83=function(_0x2efcfc,_0x2aac80){_0x2efcfc=_0x2efcfc-0x0;var _0x2363be=_0xb835[_0x2efcfc];return _0x2363be;};'use strict';var _=require(_0x5b83('0x0'));var util=require(_0x5b83('0x1'));var moment=require('moment');var BPromise=require(_0x5b83('0x2'));var rs=require(_0x5b83('0x3'));var fs=require('fs');var Redis=require(_0x5b83('0x4'));var db=require(_0x5b83('0x5'))['db'];var utils=require(_0x5b83('0x6'));var logger=require(_0x5b83('0x7'))(_0x5b83('0x8'));var config=require(_0x5b83('0x9'));var jayson=require(_0x5b83('0xa'));var client=jayson[_0x5b83('0xb')][_0x5b83('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x441a67,_0x4ecb2,_0x10a72c){return new BPromise(function(_0x3ee1c6,_0x401a5c){return client[_0x5b83('0xd')](_0x441a67,_0x10a72c)[_0x5b83('0xe')](function(_0x4683ec){logger[_0x5b83('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x4ecb2,_0x5b83('0x10'));logger['debug'](_0x5b83('0x11'),_0x4ecb2,'request\x20sent',JSON['stringify'](_0x4683ec));if(_0x4683ec[_0x5b83('0x12')]){if(_0x4683ec[_0x5b83('0x12')]['code']===0x1f4){logger[_0x5b83('0x12')](_0x5b83('0x13'),_0x4ecb2,_0x4683ec[_0x5b83('0x12')][_0x5b83('0x14')]);return _0x401a5c(_0x4683ec['error'][_0x5b83('0x14')]);}logger[_0x5b83('0x12')](_0x5b83('0x13'),_0x4ecb2,_0x4683ec[_0x5b83('0x12')][_0x5b83('0x14')]);return _0x3ee1c6(_0x4683ec['error'][_0x5b83('0x14')]);}else{logger[_0x5b83('0xf')](_0x5b83('0x13'),_0x4ecb2,_0x5b83('0x10'));_0x3ee1c6(_0x4683ec[_0x5b83('0x15')][_0x5b83('0x14')]);}})[_0x5b83('0x16')](function(_0x23aa5b){logger[_0x5b83('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x4ecb2,_0x23aa5b);_0x401a5c(_0x23aa5b);});});}