Built motion from commit 449495f6.|2.6.27
[motion2.git] / server / api / voiceAgentReport / voiceAgentReport.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 _0x2ffa=['attributes','limit','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','UpdateVoiceAgentReport','update','where'];(function(_0xf99a59,_0x115b65){var _0x1011c6=function(_0x597520){while(--_0x597520){_0xf99a59['push'](_0xf99a59['shift']());}};_0x1011c6(++_0x115b65);}(_0x2ffa,0x1ed));var _0xa2ff=function(_0x15c9e9,_0x4d49c6){_0x15c9e9=_0x15c9e9-0x0;var _0x32874d=_0x2ffa[_0x15c9e9];return _0x32874d;};'use strict';var _=require(_0xa2ff('0x0'));var util=require(_0xa2ff('0x1'));var moment=require(_0xa2ff('0x2'));var BPromise=require(_0xa2ff('0x3'));var rs=require(_0xa2ff('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa2ff('0x5'))['db'];var utils=require(_0xa2ff('0x6'));var logger=require(_0xa2ff('0x7'))('rpc');var config=require(_0xa2ff('0x8'));var jayson=require(_0xa2ff('0x9'));var client=jayson[_0xa2ff('0xa')][_0xa2ff('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x291521,_0x2d22b0,_0x3af9e3){return new BPromise(function(_0x311e72,_0x12f1b8){return client[_0xa2ff('0xc')](_0x291521,_0x3af9e3)[_0xa2ff('0xd')](function(_0x5d90a2){logger[_0xa2ff('0xe')](_0xa2ff('0xf'),_0x2d22b0,'request\x20sent');logger[_0xa2ff('0x10')](_0xa2ff('0x11'),_0x2d22b0,_0xa2ff('0x12'),JSON['stringify'](_0x5d90a2));if(_0x5d90a2[_0xa2ff('0x13')]){if(_0x5d90a2[_0xa2ff('0x13')][_0xa2ff('0x14')]===0x1f4){logger[_0xa2ff('0x13')](_0xa2ff('0xf'),_0x2d22b0,_0x5d90a2[_0xa2ff('0x13')]['message']);return _0x12f1b8(_0x5d90a2[_0xa2ff('0x13')][_0xa2ff('0x15')]);}logger[_0xa2ff('0x13')]('VoiceAgentReport,\x20%s,\x20%s',_0x2d22b0,_0x5d90a2[_0xa2ff('0x13')]['message']);return _0x311e72(_0x5d90a2['error'][_0xa2ff('0x15')]);}else{logger['info'](_0xa2ff('0xf'),_0x2d22b0,_0xa2ff('0x12'));_0x311e72(_0x5d90a2['result'][_0xa2ff('0x15')]);}})[_0xa2ff('0x16')](function(_0x4b40f5){logger[_0xa2ff('0x13')](_0xa2ff('0xf'),_0x2d22b0,_0x4b40f5);_0x12f1b8(_0x4b40f5);});});}exports[_0xa2ff('0x17')]=function(_0x37b04b){var _0x2bfca5=this;return new Promise(function(_0xdd9912,_0x4b8c25){return db[_0xa2ff('0x18')][_0xa2ff('0x19')](_0x37b04b[_0xa2ff('0x1a')],{'raw':_0x37b04b[_0xa2ff('0x1b')]?_0x37b04b[_0xa2ff('0x1b')][_0xa2ff('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x3fa0ef){logger[_0xa2ff('0xe')](_0xa2ff('0x17'),_0x37b04b);logger[_0xa2ff('0x10')]('CreateVoiceAgentReport',_0x37b04b,JSON['stringify'](_0x3fa0ef));_0xdd9912(_0x3fa0ef);})[_0xa2ff('0x16')](function(_0x2ff6ef){logger[_0xa2ff('0x13')](_0xa2ff('0x17'),_0x2ff6ef[_0xa2ff('0x15')],_0x37b04b);_0x4b8c25(_0x2bfca5[_0xa2ff('0x13')](0x1f4,_0x2ff6ef[_0xa2ff('0x15')]));});});};exports[_0xa2ff('0x1d')]=function(_0x5e7fd3){var _0x28cf5c=this;return new Promise(function(_0x3cca75,_0x169f74){return db[_0xa2ff('0x18')][_0xa2ff('0x1e')](_0x5e7fd3[_0xa2ff('0x1a')],{'raw':_0x5e7fd3[_0xa2ff('0x1b')]?_0x5e7fd3[_0xa2ff('0x1b')][_0xa2ff('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e7fd3['options']?_0x5e7fd3['options'][_0xa2ff('0x1f')]||null:null,'attributes':_0x5e7fd3[_0xa2ff('0x1b')]?_0x5e7fd3[_0xa2ff('0x1b')][_0xa2ff('0x20')]||null:null,'limit':_0x5e7fd3['options']?_0x5e7fd3[_0xa2ff('0x1b')][_0xa2ff('0x21')]||null:null})[_0xa2ff('0xd')](function(_0x2b6cdc){logger[_0xa2ff('0xe')](_0xa2ff('0x1d'),_0x5e7fd3);logger[_0xa2ff('0x10')](_0xa2ff('0x1d'),_0x5e7fd3,JSON[_0xa2ff('0x22')](_0x2b6cdc));_0x3cca75(_0x2b6cdc);})[_0xa2ff('0x16')](function(_0x6494f9){logger[_0xa2ff('0x13')](_0xa2ff('0x1d'),_0x6494f9[_0xa2ff('0x15')],_0x5e7fd3);_0x169f74(_0x28cf5c[_0xa2ff('0x13')](0x1f4,_0x6494f9[_0xa2ff('0x15')]));});});};