Built motion from commit 52c8a02d.|2.6.29
[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 _0x0ec8=['../../config/environment','client','http','request','then','info','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatTransferReport,\x20%s,\x20%s','lodash','util','moment','bluebird','randomstring','ioredis','rpc'];(function(_0x2937d8,_0x622345){var _0x376bb2=function(_0x34c063){while(--_0x34c063){_0x2937d8['push'](_0x2937d8['shift']());}};_0x376bb2(++_0x622345);}(_0x0ec8,0xd5));var _0x80ec=function(_0x3ea535,_0x539a8e){_0x3ea535=_0x3ea535-0x0;var _0x59c8d5=_0x0ec8[_0x3ea535];return _0x59c8d5;};'use strict';var _=require(_0x80ec('0x0'));var util=require(_0x80ec('0x1'));var moment=require(_0x80ec('0x2'));var BPromise=require(_0x80ec('0x3'));var rs=require(_0x80ec('0x4'));var fs=require('fs');var Redis=require(_0x80ec('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x80ec('0x6'));var config=require(_0x80ec('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x80ec('0x8')][_0x80ec('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f2e0e,_0x328d9b,_0x163923){return new BPromise(function(_0x1e238a,_0x410eb5){return client[_0x80ec('0xa')](_0x4f2e0e,_0x163923)[_0x80ec('0xb')](function(_0x354139){logger[_0x80ec('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0x328d9b,'request\x20sent');logger[_0x80ec('0xd')](_0x80ec('0xe'),_0x328d9b,'request\x20sent',JSON[_0x80ec('0xf')](_0x354139));if(_0x354139[_0x80ec('0x10')]){if(_0x354139[_0x80ec('0x10')][_0x80ec('0x11')]===0x1f4){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x328d9b,_0x354139[_0x80ec('0x10')][_0x80ec('0x12')]);return _0x410eb5(_0x354139[_0x80ec('0x10')][_0x80ec('0x12')]);}logger[_0x80ec('0x10')](_0x80ec('0x13'),_0x328d9b,_0x354139[_0x80ec('0x10')][_0x80ec('0x12')]);return _0x1e238a(_0x354139['error'][_0x80ec('0x12')]);}else{logger[_0x80ec('0xc')](_0x80ec('0x13'),_0x328d9b,'request\x20sent');_0x1e238a(_0x354139['result'][_0x80ec('0x12')]);}})['catch'](function(_0x3d5061){logger[_0x80ec('0x10')](_0x80ec('0x13'),_0x328d9b,_0x3d5061);_0x410eb5(_0x3d5061);});});}