30ad8cb88a07920ca191d719561e72b61009acee
[motion-next.git] / server / api / voiceCallReport / voiceCallReport.rpc.js
1 const a711_0x5135=['CreateVoiceCallReport','limit','include','message','../../mysqldb','update','create','../../config/logger','attributes','model','info','findAll','raw','lodash','GetVoiceCallReport','catch','stringify','body','debug','VoiceCallReport','UpdateVoiceCallReport','error','rpc','then','options'];(function(_0x27b68f,_0x513576){const _0x6a9cf0=function(_0x2d81d5){while(--_0x2d81d5){_0x27b68f['push'](_0x27b68f['shift']());}};_0x6a9cf0(++_0x513576);}(a711_0x5135,0x1c4));const a711_0x6a9c=function(_0x27b68f,_0x513576){_0x27b68f=_0x27b68f-0x0;let _0x6a9cf0=a711_0x5135[_0x27b68f];return _0x6a9cf0;};const _0x2e8a6b=a711_0x6a9c;'use strict';const _=require(_0x2e8a6b('0xb')),db=require(_0x2e8a6b('0x2'))['db'],logger=require(_0x2e8a6b('0x5'))(_0x2e8a6b('0x14'));exports['GetVoiceCallReport']=function(_0x2d81d5){const _0x334f80=this;return new Promise(function(_0x4c577c,_0x19abe2){const _0x4355e3=a711_0x6a9c;return db[_0x4355e3('0x11')][_0x4355e3('0x9')]({'raw':_0x2d81d5['options']?_0x2d81d5[_0x4355e3('0x16')][_0x4355e3('0xa')]===undefined?!![]:![]:!![],'where':_0x2d81d5[_0x4355e3('0x16')]?_0x2d81d5['options']['where']||null:null,'attributes':_0x2d81d5[_0x4355e3('0x16')]?_0x2d81d5[_0x4355e3('0x16')]['attributes']||null:null,'limit':_0x2d81d5[_0x4355e3('0x16')]?_0x2d81d5['options'][_0x4355e3('0x18')]||null:null,'include':_0x2d81d5['options']?_0x2d81d5[_0x4355e3('0x16')][_0x4355e3('0x0')]?_['map'](_0x2d81d5['options'][_0x4355e3('0x0')],function(_0x4efadc){const _0x94a664=_0x4355e3;return{'model':db[_0x4efadc[_0x94a664('0x7')]],'as':_0x4efadc['as'],'attributes':_0x4efadc[_0x94a664('0x6')],'include':_0x4efadc['include']?_['map'](_0x4efadc[_0x94a664('0x0')],function(_0x52202e){const _0x257a51=_0x94a664;return{'model':db[_0x52202e[_0x257a51('0x7')]],'as':_0x52202e['as'],'attributes':_0x52202e[_0x257a51('0x6')],'include':_0x52202e[_0x257a51('0x0')]?_['map'](_0x52202e[_0x257a51('0x0')],function(_0xafeec6){const _0x24aa2f=_0x257a51;return{'model':db[_0xafeec6[_0x24aa2f('0x7')]],'as':_0xafeec6['as'],'attributes':_0xafeec6['attributes']};}):[]};}):[]};}):[]:[]})[_0x4355e3('0x15')](function(_0x2b4f38){const _0x1b2e97=_0x4355e3;logger[_0x1b2e97('0x8')](_0x1b2e97('0xc'),_0x2d81d5),logger[_0x1b2e97('0x10')]('GetVoiceCallReport',_0x2d81d5,JSON[_0x1b2e97('0xe')](_0x2b4f38)),_0x4c577c(_0x2b4f38);})[_0x4355e3('0xd')](function(_0x54d746){const _0x2aeb97=_0x4355e3;logger[_0x2aeb97('0x13')](_0x2aeb97('0xc'),_0x54d746[_0x2aeb97('0x1')],_0x2d81d5),_0x19abe2(_0x334f80[_0x2aeb97('0x13')](0x1f4,_0x54d746[_0x2aeb97('0x1')]));});});},exports[_0x2e8a6b('0x17')]=function(_0x395248){const _0x18c076=this;return new Promise(function(_0xb2eee7,_0x309d96){const _0x250022=a711_0x6a9c;return db[_0x250022('0x11')][_0x250022('0x4')](_0x395248['body'],{'raw':_0x395248[_0x250022('0x16')]?_0x395248[_0x250022('0x16')]['raw']===undefined?!![]:![]:!![]})[_0x250022('0x15')](function(_0x830024){const _0x3f58f9=_0x250022;logger['info'](_0x3f58f9('0x17'),_0x395248),logger['debug'](_0x3f58f9('0x17'),_0x395248,JSON[_0x3f58f9('0xe')](_0x830024)),_0xb2eee7(_0x830024);})[_0x250022('0xd')](function(_0x3c3b8){const _0x5d8c25=_0x250022;logger[_0x5d8c25('0x13')]('CreateVoiceCallReport',_0x3c3b8[_0x5d8c25('0x1')],_0x395248),_0x309d96(_0x18c076[_0x5d8c25('0x13')](0x1f4,_0x3c3b8['message']));});});},exports[_0x2e8a6b('0x12')]=function(_0x58a290){const _0x45cbc6=this;return new Promise(function(_0x21c491,_0x5024a1){const _0x5c1942=a711_0x6a9c;return db[_0x5c1942('0x11')][_0x5c1942('0x3')](_0x58a290[_0x5c1942('0xf')],{'raw':_0x58a290['options']?_0x58a290['options'][_0x5c1942('0xa')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58a290['options']?_0x58a290[_0x5c1942('0x16')]['where']||null:null,'attributes':_0x58a290['options']?_0x58a290['options']['attributes']||null:null,'limit':_0x58a290[_0x5c1942('0x16')]?_0x58a290['options'][_0x5c1942('0x18')]||null:null})[_0x5c1942('0x15')](function(_0x34e151){const _0x132bb5=_0x5c1942;logger[_0x132bb5('0x8')](_0x132bb5('0x12'),_0x58a290),logger['debug']('UpdateVoiceCallReport',_0x58a290,JSON[_0x132bb5('0xe')](_0x34e151)),_0x21c491(_0x34e151);})[_0x5c1942('0xd')](function(_0x40e568){const _0x2c4b03=_0x5c1942;logger[_0x2c4b03('0x13')](_0x2c4b03('0x12'),_0x40e568['message'],_0x58a290),_0x5024a1(_0x45cbc6[_0x2c4b03('0x13')](0x1f4,_0x40e568[_0x2c4b03('0x1')]));});});};