ed5e0cae0bf34d4b6dcc9f3c329664b202e07811
[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 _0x29c4=['info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x29c4,0xc6));var _0x429c=function(_0x26e61f,_0x1a09dd){_0x26e61f=_0x26e61f-0x0;var _0x36242b=_0x29c4[_0x26e61f];return _0x36242b;};'use strict';var _=require(_0x429c('0x0'));var util=require(_0x429c('0x1'));var moment=require(_0x429c('0x2'));var BPromise=require('bluebird');var rs=require(_0x429c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x429c('0x4'))['db'];var utils=require(_0x429c('0x5'));var logger=require(_0x429c('0x6'))(_0x429c('0x7'));var config=require('../../config/environment');var jayson=require(_0x429c('0x8'));var client=jayson['client'][_0x429c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x197584,_0x1c340e,_0x4314be){return new BPromise(function(_0x16b822,_0x12b7bb){return client[_0x429c('0xa')](_0x197584,_0x4314be)[_0x429c('0xb')](function(_0xde7858){logger[_0x429c('0xc')](_0x429c('0xd'),_0x1c340e,_0x429c('0xe'));logger['debug'](_0x429c('0xf'),_0x1c340e,_0x429c('0xe'),JSON[_0x429c('0x10')](_0xde7858));if(_0xde7858[_0x429c('0x11')]){if(_0xde7858[_0x429c('0x11')][_0x429c('0x12')]===0x1f4){logger[_0x429c('0x11')](_0x429c('0xd'),_0x1c340e,_0xde7858['error'][_0x429c('0x13')]);return _0x12b7bb(_0xde7858[_0x429c('0x11')][_0x429c('0x13')]);}logger[_0x429c('0x11')](_0x429c('0xd'),_0x1c340e,_0xde7858[_0x429c('0x11')][_0x429c('0x13')]);return _0x16b822(_0xde7858[_0x429c('0x11')][_0x429c('0x13')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x1c340e,_0x429c('0xe'));_0x16b822(_0xde7858['result']['message']);}})[_0x429c('0x14')](function(_0x473098){logger[_0x429c('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x1c340e,_0x473098);_0x12b7bb(_0x473098);});});}