Built motion from commit (unavailable).|2.5.23
[motion2.git] / server / api / voiceDialReport / voiceDialReport.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 _0x5fb8=['create','options','raw','info','UpdateVoiceDialReport','update','where','attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','VoiceDialReport,\x20%s,\x20%s','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateVoiceDialReport','VoiceDialReport'];(function(_0x3f0fb0,_0x4cfdf9){var _0xe5308d=function(_0x13ee89){while(--_0x13ee89){_0x3f0fb0['push'](_0x3f0fb0['shift']());}};_0xe5308d(++_0x4cfdf9);}(_0x5fb8,0x13b));var _0x85fb=function(_0x4b07bb,_0x1b3859){_0x4b07bb=_0x4b07bb-0x0;var _0x2e725f=_0x5fb8[_0x4b07bb];return _0x2e725f;};'use strict';var _=require(_0x85fb('0x0'));var util=require(_0x85fb('0x1'));var moment=require(_0x85fb('0x2'));var BPromise=require('bluebird');var rs=require(_0x85fb('0x3'));var fs=require('fs');var Redis=require(_0x85fb('0x4'));var db=require(_0x85fb('0x5'))['db'];var utils=require(_0x85fb('0x6'));var logger=require(_0x85fb('0x7'))(_0x85fb('0x8'));var config=require(_0x85fb('0x9'));var jayson=require(_0x85fb('0xa'));var client=jayson['client'][_0x85fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x32156d,_0x5026a2,_0x552aa6){return new BPromise(function(_0x1b4b68,_0xa39ed1){return client['request'](_0x32156d,_0x552aa6)[_0x85fb('0xc')](function(_0x3ccd14){logger['info'](_0x85fb('0xd'),_0x5026a2,'request\x20sent');logger[_0x85fb('0xe')](_0x85fb('0xf'),_0x5026a2,_0x85fb('0x10'),JSON[_0x85fb('0x11')](_0x3ccd14));if(_0x3ccd14[_0x85fb('0x12')]){if(_0x3ccd14[_0x85fb('0x12')][_0x85fb('0x13')]===0x1f4){logger[_0x85fb('0x12')](_0x85fb('0xd'),_0x5026a2,_0x3ccd14['error'][_0x85fb('0x14')]);return _0xa39ed1(_0x3ccd14[_0x85fb('0x12')][_0x85fb('0x14')]);}logger[_0x85fb('0x12')]('VoiceDialReport,\x20%s,\x20%s',_0x5026a2,_0x3ccd14[_0x85fb('0x12')][_0x85fb('0x14')]);return _0x1b4b68(_0x3ccd14[_0x85fb('0x12')][_0x85fb('0x14')]);}else{logger['info'](_0x85fb('0xd'),_0x5026a2,'request\x20sent');_0x1b4b68(_0x3ccd14[_0x85fb('0x15')][_0x85fb('0x14')]);}})[_0x85fb('0x16')](function(_0x33cdda){logger[_0x85fb('0x12')](_0x85fb('0xd'),_0x5026a2,_0x33cdda);_0xa39ed1(_0x33cdda);});});}exports[_0x85fb('0x17')]=function(_0x531c0a){var _0x1ace3d=this;return new Promise(function(_0x5723bd,_0x1c191e){return db[_0x85fb('0x18')][_0x85fb('0x19')](_0x531c0a['body'],{'raw':_0x531c0a[_0x85fb('0x1a')]?_0x531c0a['options'][_0x85fb('0x1b')]===undefined?!![]:![]:!![]})[_0x85fb('0xc')](function(_0xff0463){logger[_0x85fb('0x1c')](_0x85fb('0x17'),_0x531c0a);logger[_0x85fb('0xe')]('CreateVoiceDialReport',_0x531c0a,JSON[_0x85fb('0x11')](_0xff0463));_0x5723bd(_0xff0463);})[_0x85fb('0x16')](function(_0xb0764f){logger[_0x85fb('0x12')](_0x85fb('0x17'),_0xb0764f[_0x85fb('0x14')],_0x531c0a);_0x1c191e(_0x1ace3d[_0x85fb('0x12')](0x1f4,_0xb0764f[_0x85fb('0x14')]));});});};exports[_0x85fb('0x1d')]=function(_0xf9ec63){var _0x3122f7=this;return new Promise(function(_0x4c7769,_0x3d41a6){return db[_0x85fb('0x18')][_0x85fb('0x1e')](_0xf9ec63['body'],{'raw':_0xf9ec63['options']?_0xf9ec63[_0x85fb('0x1a')][_0x85fb('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf9ec63[_0x85fb('0x1a')]?_0xf9ec63['options'][_0x85fb('0x1f')]||null:null,'attributes':_0xf9ec63[_0x85fb('0x1a')]?_0xf9ec63[_0x85fb('0x1a')][_0x85fb('0x20')]||null:null,'limit':_0xf9ec63['options']?_0xf9ec63['options'][_0x85fb('0x21')]||null:null})[_0x85fb('0xc')](function(_0x33d550){logger['info']('UpdateVoiceDialReport',_0xf9ec63);logger['debug'](_0x85fb('0x1d'),_0xf9ec63,JSON['stringify'](_0x33d550));_0x4c7769(_0x33d550);})[_0x85fb('0x16')](function(_0x3c8a71){logger[_0x85fb('0x12')](_0x85fb('0x1d'),_0x3c8a71[_0x85fb('0x14')],_0xf9ec63);_0x3d41a6(_0x3122f7[_0x85fb('0x12')](0x1f4,_0x3c8a71[_0x85fb('0x14')]));});});};