Built motion from commit a61a4a20.|2.5.46
[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 _0x3a81=['request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatTransferReport,\x20%s,\x20%s'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x3a81,0x190));var _0x13a8=function(_0xe1a964,_0x5ec09d){_0xe1a964=_0xe1a964-0x0;var _0x3de37b=_0x3a81[_0xe1a964];return _0x3de37b;};'use strict';var _=require('lodash');var util=require(_0x13a8('0x0'));var moment=require(_0x13a8('0x1'));var BPromise=require(_0x13a8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x13a8('0x3'));var db=require(_0x13a8('0x4'))['db'];var utils=require(_0x13a8('0x5'));var logger=require('../../config/logger')(_0x13a8('0x6'));var config=require(_0x13a8('0x7'));var jayson=require(_0x13a8('0x8'));var client=jayson[_0x13a8('0x9')][_0x13a8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1bc1ba,_0x44e462,_0x16a717){return new BPromise(function(_0x36b65a,_0x2d69df){return client[_0x13a8('0xb')](_0x1bc1ba,_0x16a717)[_0x13a8('0xc')](function(_0x489379){logger['info'](_0x13a8('0xd'),_0x44e462,_0x13a8('0xe'));logger[_0x13a8('0xf')](_0x13a8('0x10'),_0x44e462,'request\x20sent',JSON[_0x13a8('0x11')](_0x489379));if(_0x489379[_0x13a8('0x12')]){if(_0x489379[_0x13a8('0x12')]['code']===0x1f4){logger[_0x13a8('0x12')](_0x13a8('0xd'),_0x44e462,_0x489379['error'][_0x13a8('0x13')]);return _0x2d69df(_0x489379[_0x13a8('0x12')][_0x13a8('0x13')]);}logger[_0x13a8('0x12')](_0x13a8('0xd'),_0x44e462,_0x489379['error'][_0x13a8('0x13')]);return _0x36b65a(_0x489379[_0x13a8('0x12')][_0x13a8('0x13')]);}else{logger[_0x13a8('0x14')](_0x13a8('0xd'),_0x44e462,_0x13a8('0xe'));_0x36b65a(_0x489379[_0x13a8('0x15')][_0x13a8('0x13')]);}})[_0x13a8('0x16')](function(_0x43b241){logger[_0x13a8('0x12')](_0x13a8('0xd'),_0x44e462,_0x43b241);_0x2d69df(_0x43b241);});});}