b20c68d9f20a0b121d35f0b854377f90d9a84e44
[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 _0x757b=['then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request'];(function(_0x2e61dd,_0x5131b7){var _0x41f98c=function(_0x55b2e8){while(--_0x55b2e8){_0x2e61dd['push'](_0x2e61dd['shift']());}};_0x41f98c(++_0x5131b7);}(_0x757b,0x88));var _0xb757=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x757b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb757('0x0'));var util=require(_0xb757('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb757('0x2'));var fs=require('fs');var Redis=require(_0xb757('0x3'));var db=require(_0xb757('0x4'))['db'];var utils=require(_0xb757('0x5'));var logger=require(_0xb757('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb757('0x7'));var client=jayson[_0xb757('0x8')][_0xb757('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x535a6a,_0x2bce4b,_0x456493){return new BPromise(function(_0x11a6ba,_0x4d77d8){return client[_0xb757('0xa')](_0x535a6a,_0x456493)[_0xb757('0xb')](function(_0x3d184f){logger[_0xb757('0xc')](_0xb757('0xd'),_0x2bce4b,_0xb757('0xe'));logger['debug']('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x2bce4b,_0xb757('0xe'),JSON[_0xb757('0xf')](_0x3d184f));if(_0x3d184f['error']){if(_0x3d184f[_0xb757('0x10')][_0xb757('0x11')]===0x1f4){logger[_0xb757('0x10')](_0xb757('0xd'),_0x2bce4b,_0x3d184f[_0xb757('0x10')][_0xb757('0x12')]);return _0x4d77d8(_0x3d184f[_0xb757('0x10')][_0xb757('0x12')]);}logger[_0xb757('0x10')](_0xb757('0xd'),_0x2bce4b,_0x3d184f[_0xb757('0x10')][_0xb757('0x12')]);return _0x11a6ba(_0x3d184f['error'][_0xb757('0x12')]);}else{logger[_0xb757('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0x2bce4b,_0xb757('0xe'));_0x11a6ba(_0x3d184f[_0xb757('0x13')][_0xb757('0x12')]);}})[_0xb757('0x14')](function(_0x2256c0){logger[_0xb757('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x2bce4b,_0x2256c0);_0x4d77d8(_0x2256c0);});});}