Built motion from commit 511216ff.|2.6.34
[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 _0x3622=['debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x41640b,_0x112967){var _0x59a6c2=function(_0xdfe556){while(--_0xdfe556){_0x41640b['push'](_0x41640b['shift']());}};_0x59a6c2(++_0x112967);}(_0x3622,0x1a5));var _0x2362=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x3622[_0xc4001c];return _0x49f7bc;};'use strict';var _=require('lodash');var util=require(_0x2362('0x0'));var moment=require(_0x2362('0x1'));var BPromise=require(_0x2362('0x2'));var rs=require(_0x2362('0x3'));var fs=require('fs');var Redis=require(_0x2362('0x4'));var db=require(_0x2362('0x5'))['db'];var utils=require(_0x2362('0x6'));var logger=require(_0x2362('0x7'))('rpc');var config=require(_0x2362('0x8'));var jayson=require(_0x2362('0x9'));var client=jayson[_0x2362('0xa')][_0x2362('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2c8aef,_0x59acc4,_0x1381bc){return new BPromise(function(_0x3b11e2,_0x4ada03){return client[_0x2362('0xc')](_0x2c8aef,_0x1381bc)[_0x2362('0xd')](function(_0x4c35d4){logger['info'](_0x2362('0xe'),_0x59acc4,_0x2362('0xf'));logger[_0x2362('0x10')](_0x2362('0x11'),_0x59acc4,'request\x20sent',JSON[_0x2362('0x12')](_0x4c35d4));if(_0x4c35d4[_0x2362('0x13')]){if(_0x4c35d4[_0x2362('0x13')]['code']===0x1f4){logger[_0x2362('0x13')]('ChatTransferReport,\x20%s,\x20%s',_0x59acc4,_0x4c35d4['error'][_0x2362('0x14')]);return _0x4ada03(_0x4c35d4['error'][_0x2362('0x14')]);}logger[_0x2362('0x13')](_0x2362('0xe'),_0x59acc4,_0x4c35d4[_0x2362('0x13')]['message']);return _0x3b11e2(_0x4c35d4[_0x2362('0x13')][_0x2362('0x14')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x59acc4,_0x2362('0xf'));_0x3b11e2(_0x4c35d4[_0x2362('0x15')][_0x2362('0x14')]);}})[_0x2362('0x16')](function(_0x3a092e){logger['error'](_0x2362('0xe'),_0x59acc4,_0x3a092e);_0x4ada03(_0x3a092e);});});}