ca4e666fe3faec3f11352decad1affd80e4f4c5a
[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 _0x516b=['raw','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0x516b,0x1dd));var _0xb516=function(_0x57fcc0,_0x585004){_0x57fcc0=_0x57fcc0-0x0;var _0x5270df=_0x516b[_0x57fcc0];return _0x5270df;};'use strict';var _=require(_0xb516('0x0'));var util=require('util');var moment=require(_0xb516('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb516('0x2'));var db=require(_0xb516('0x3'))['db'];var utils=require(_0xb516('0x4'));var logger=require(_0xb516('0x5'))(_0xb516('0x6'));var config=require(_0xb516('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb516('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x44d416,_0x1051da,_0x55063f){return new BPromise(function(_0xa5c4a5,_0x1172b6){return client[_0xb516('0x9')](_0x44d416,_0x55063f)[_0xb516('0xa')](function(_0x30cbc4){logger[_0xb516('0xb')](_0xb516('0xc'),_0x1051da,_0xb516('0xd'));logger[_0xb516('0xe')](_0xb516('0xf'),_0x1051da,_0xb516('0xd'),JSON[_0xb516('0x10')](_0x30cbc4));if(_0x30cbc4[_0xb516('0x11')]){if(_0x30cbc4['error'][_0xb516('0x12')]===0x1f4){logger[_0xb516('0x11')](_0xb516('0xc'),_0x1051da,_0x30cbc4[_0xb516('0x11')][_0xb516('0x13')]);return _0x1172b6(_0x30cbc4[_0xb516('0x11')][_0xb516('0x13')]);}logger[_0xb516('0x11')](_0xb516('0xc'),_0x1051da,_0x30cbc4[_0xb516('0x11')][_0xb516('0x13')]);return _0xa5c4a5(_0x30cbc4[_0xb516('0x11')]['message']);}else{logger[_0xb516('0xb')](_0xb516('0xc'),_0x1051da,_0xb516('0xd'));_0xa5c4a5(_0x30cbc4[_0xb516('0x14')][_0xb516('0x13')]);}})[_0xb516('0x15')](function(_0x419510){logger[_0xb516('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x1051da,_0x419510);_0x1172b6(_0x419510);});});}exports[_0xb516('0x16')]=function(_0x6466e8){var _0x44b432=this;return new Promise(function(_0x1b32d6,_0x40cebe){return db[_0xb516('0x17')][_0xb516('0x18')](_0x6466e8[_0xb516('0x19')],{'raw':_0x6466e8[_0xb516('0x1a')]?_0x6466e8[_0xb516('0x1a')][_0xb516('0x1b')]===undefined?!![]:![]:!![]})[_0xb516('0xa')](function(_0xbef853){logger[_0xb516('0xb')]('CreateVoiceTransferReport',_0x6466e8);logger[_0xb516('0xe')](_0xb516('0x16'),_0x6466e8,JSON[_0xb516('0x10')](_0xbef853));_0x1b32d6(_0xbef853);})[_0xb516('0x15')](function(_0x14e644){logger[_0xb516('0x11')](_0xb516('0x16'),_0x14e644['message'],_0x6466e8);_0x40cebe(_0x44b432[_0xb516('0x11')](0x1f4,_0x14e644[_0xb516('0x13')]));});});};