Built motion from commit e1760111.|2.6.18
[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 _0xfc0c=['ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x2cb3eb,_0x4d83aa){var _0x2759ee=function(_0x4108a0){while(--_0x4108a0){_0x2cb3eb['push'](_0x2cb3eb['shift']());}};_0x2759ee(++_0x4d83aa);}(_0xfc0c,0xa6));var _0xcfc0=function(_0x57e34f,_0x475a13){_0x57e34f=_0x57e34f-0x0;var _0x4d047d=_0xfc0c[_0x57e34f];return _0x4d047d;};'use strict';var _=require(_0xcfc0('0x0'));var util=require('util');var moment=require(_0xcfc0('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcfc0('0x2'))['db'];var utils=require(_0xcfc0('0x3'));var logger=require(_0xcfc0('0x4'))(_0xcfc0('0x5'));var config=require(_0xcfc0('0x6'));var jayson=require(_0xcfc0('0x7'));var client=jayson[_0xcfc0('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x173fb8,_0x4224f1,_0xa1901f){return new BPromise(function(_0x36e87b,_0x44d095){return client[_0xcfc0('0x9')](_0x173fb8,_0xa1901f)[_0xcfc0('0xa')](function(_0x4058bd){logger[_0xcfc0('0xb')](_0xcfc0('0xc'),_0x4224f1,_0xcfc0('0xd'));logger['debug'](_0xcfc0('0xe'),_0x4224f1,'request\x20sent',JSON['stringify'](_0x4058bd));if(_0x4058bd[_0xcfc0('0xf')]){if(_0x4058bd[_0xcfc0('0xf')][_0xcfc0('0x10')]===0x1f4){logger[_0xcfc0('0xf')](_0xcfc0('0xc'),_0x4224f1,_0x4058bd[_0xcfc0('0xf')][_0xcfc0('0x11')]);return _0x44d095(_0x4058bd['error'][_0xcfc0('0x11')]);}logger[_0xcfc0('0xf')](_0xcfc0('0xc'),_0x4224f1,_0x4058bd[_0xcfc0('0xf')][_0xcfc0('0x11')]);return _0x36e87b(_0x4058bd['error'][_0xcfc0('0x11')]);}else{logger[_0xcfc0('0xb')](_0xcfc0('0xc'),_0x4224f1,'request\x20sent');_0x36e87b(_0x4058bd[_0xcfc0('0x12')][_0xcfc0('0x11')]);}})[_0xcfc0('0x13')](function(_0x8739db){logger['error'](_0xcfc0('0xc'),_0x4224f1,_0x8739db);_0x44d095(_0x8739db);});});}