462d753d97a75736d1d7cce87ac4850caf8ad418
[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 _0x02a2=['client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x02a2,0x116));var _0x202a=function(_0x1c6b91,_0x399c82){_0x1c6b91=_0x1c6b91-0x0;var _0x522c9a=_0x02a2[_0x1c6b91];return _0x522c9a;};'use strict';var _=require(_0x202a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x202a('0x1'));var rs=require(_0x202a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x202a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x202a('0x4'))(_0x202a('0x5'));var config=require(_0x202a('0x6'));var jayson=require(_0x202a('0x7'));var client=jayson[_0x202a('0x8')][_0x202a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x31ea05,_0x5b95ed,_0x31fa3f){return new BPromise(function(_0x2b3cae,_0x33c7e9){return client[_0x202a('0xa')](_0x31ea05,_0x31fa3f)[_0x202a('0xb')](function(_0x26efd7){logger[_0x202a('0xc')](_0x202a('0xd'),_0x5b95ed,_0x202a('0xe'));logger[_0x202a('0xf')](_0x202a('0x10'),_0x5b95ed,_0x202a('0xe'),JSON[_0x202a('0x11')](_0x26efd7));if(_0x26efd7['error']){if(_0x26efd7[_0x202a('0x12')]['code']===0x1f4){logger[_0x202a('0x12')](_0x202a('0xd'),_0x5b95ed,_0x26efd7['error']['message']);return _0x33c7e9(_0x26efd7[_0x202a('0x12')][_0x202a('0x13')]);}logger[_0x202a('0x12')](_0x202a('0xd'),_0x5b95ed,_0x26efd7[_0x202a('0x12')][_0x202a('0x13')]);return _0x2b3cae(_0x26efd7[_0x202a('0x12')][_0x202a('0x13')]);}else{logger[_0x202a('0xc')](_0x202a('0xd'),_0x5b95ed,_0x202a('0xe'));_0x2b3cae(_0x26efd7[_0x202a('0x14')][_0x202a('0x13')]);}})[_0x202a('0x15')](function(_0x46c458){logger[_0x202a('0x12')](_0x202a('0xd'),_0x5b95ed,_0x46c458);_0x33c7e9(_0x46c458);});});}