802d6f26ff05c903ff8c5c92911d971d1cfdb7b9
[motion2.git] / server / api / voiceTransferReport / voiceTransferReport.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 _0xc98e=['info','request\x20sent','debug','error','code','VoiceTransferReport,\x20%s,\x20%s','message','result','CreateVoiceTransferReport','create','body','options','raw','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0x1c443f,_0x51319d){var _0x4a4a71=function(_0x355b73){while(--_0x355b73){_0x1c443f['push'](_0x1c443f['shift']());}};_0x4a4a71(++_0x51319d);}(_0xc98e,0x188));var _0xec98=function(_0x51910a,_0x102135){_0x51910a=_0x51910a-0x0;var _0x468384=_0xc98e[_0x51910a];return _0x468384;};'use strict';var _=require(_0xec98('0x0'));var util=require(_0xec98('0x1'));var moment=require(_0xec98('0x2'));var BPromise=require(_0xec98('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xec98('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xec98('0x5'));var logger=require(_0xec98('0x6'))(_0xec98('0x7'));var config=require(_0xec98('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xec98('0x9')][_0xec98('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4801f1,_0x10f508,_0x15eb55){return new BPromise(function(_0x2b4f8a,_0x3c0afc){return client[_0xec98('0xb')](_0x4801f1,_0x15eb55)[_0xec98('0xc')](function(_0x423579){logger[_0xec98('0xd')]('VoiceTransferReport,\x20%s,\x20%s',_0x10f508,_0xec98('0xe'));logger[_0xec98('0xf')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x10f508,_0xec98('0xe'),JSON['stringify'](_0x423579));if(_0x423579[_0xec98('0x10')]){if(_0x423579[_0xec98('0x10')][_0xec98('0x11')]===0x1f4){logger[_0xec98('0x10')](_0xec98('0x12'),_0x10f508,_0x423579[_0xec98('0x10')]['message']);return _0x3c0afc(_0x423579[_0xec98('0x10')][_0xec98('0x13')]);}logger[_0xec98('0x10')]('VoiceTransferReport,\x20%s,\x20%s',_0x10f508,_0x423579['error'][_0xec98('0x13')]);return _0x2b4f8a(_0x423579[_0xec98('0x10')][_0xec98('0x13')]);}else{logger[_0xec98('0xd')](_0xec98('0x12'),_0x10f508,_0xec98('0xe'));_0x2b4f8a(_0x423579[_0xec98('0x14')]['message']);}})['catch'](function(_0x590738){logger[_0xec98('0x10')]('VoiceTransferReport,\x20%s,\x20%s',_0x10f508,_0x590738);_0x3c0afc(_0x590738);});});}exports[_0xec98('0x15')]=function(_0x4f8a2c){var _0x453374=this;return new Promise(function(_0x411a47,_0x2aa138){return db['VoiceTransferReport'][_0xec98('0x16')](_0x4f8a2c[_0xec98('0x17')],{'raw':_0x4f8a2c['options']?_0x4f8a2c[_0xec98('0x18')][_0xec98('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1903a8){logger[_0xec98('0xd')](_0xec98('0x15'),_0x4f8a2c);logger['debug'](_0xec98('0x15'),_0x4f8a2c,JSON['stringify'](_0x1903a8));_0x411a47(_0x1903a8);})[_0xec98('0x1a')](function(_0x51e47e){logger[_0xec98('0x10')](_0xec98('0x15'),_0x51e47e[_0xec98('0x13')],_0x4f8a2c);_0x2aa138(_0x453374[_0xec98('0x10')](0x1f4,_0x51e47e['message']));});});};