Built motion from commit f738f9592c388b9f9eb3948f400a5c9d717a3561. Version 3.0.0...
[motion-next.git] / server / api / voiceRecording / voiceRecording.rpc.js
index a0ee9dc..2b7095f 100644 (file)
@@ -1 +1 @@
-const a927_0x17b6=['CreateVoiceRecording','UpdateVoiceRecording','body','callRecordingEncryption','encryptFile','format','attributes','debug','message','value','recording','unlink','stringify','then','rpc','raw','VoiceRecording','catch','secrets','update','error','info','util','options','../../components/encryptor','../../mysqldb'];(function(_0x2ce69b,_0x366ecd){const _0x17b629=function(_0x48a123){while(--_0x48a123){_0x2ce69b['push'](_0x2ce69b['shift']());}};_0x17b629(++_0x366ecd);}(a927_0x17b6,0x12e));const a927_0x48a1=function(_0x2ce69b,_0x366ecd){_0x2ce69b=_0x2ce69b-0x1d9;let _0x17b629=a927_0x17b6[_0x2ce69b];return _0x17b629;};const a927_0x33e9c4=a927_0x48a1;'use strict';const util=require(a927_0x33e9c4(0x1df)),fs=require('fs'),db=require(a927_0x33e9c4(0x1e2))['db'],logger=require('../../config/logger')(a927_0x33e9c4(0x1f1)),config=require('../../config/environment');exports['UpdateVoiceRecording']=function(_0x2fc007){const _0x238e12=this;return new Promise(function(_0x31b711,_0x4633b8){const _0x14fb9f=a927_0x48a1;return db['VoiceRecording'][_0x14fb9f(0x1dc)](_0x2fc007[_0x14fb9f(0x1e5)],{'raw':_0x2fc007['options']?_0x2fc007['options'][_0x14fb9f(0x1f2)]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2fc007['options']?_0x2fc007[_0x14fb9f(0x1e0)]['where']||null:null,'attributes':_0x2fc007[_0x14fb9f(0x1e0)]?_0x2fc007[_0x14fb9f(0x1e0)][_0x14fb9f(0x1e9)]||null:null,'limit':_0x2fc007[_0x14fb9f(0x1e0)]?_0x2fc007['options']['limit']||null:null})[_0x14fb9f(0x1f0)](function(_0x34fef8){const _0x3b09e9=_0x14fb9f;logger['info'](_0x3b09e9(0x1e4),_0x2fc007),logger['debug'](_0x3b09e9(0x1e4),_0x2fc007,JSON[_0x3b09e9(0x1ef)](_0x34fef8)),_0x31b711(_0x34fef8);})[_0x14fb9f(0x1da)](function(_0xfc8d39){const _0x3a9990=_0x14fb9f;logger[_0x3a9990(0x1dd)](_0x3a9990(0x1e4),_0xfc8d39[_0x3a9990(0x1eb)],_0x2fc007),_0x4633b8(_0x238e12[_0x3a9990(0x1dd)](0x1f4,_0xfc8d39['message']));});});},exports[a927_0x33e9c4(0x1e3)]=function(_0x464ba0){const _0x5bd897=this;return new Promise(function(_0x544aa4,_0x5b21d2){const _0x1ebfad=a927_0x48a1,_0x3694d7=require(_0x1ebfad(0x1e1));let _0x4fa59f;return db['Setting']['findOne']({'attributes':['id',_0x1ebfad(0x1e6)],'where':{'id':0x1},'raw':!![]})[_0x1ebfad(0x1f0)](function(_0x2a5b25){const _0x5becab=_0x1ebfad;return _0x4fa59f=_0x2a5b25,db[_0x5becab(0x1d9)]['create'](_0x464ba0[_0x5becab(0x1e5)]);})[_0x1ebfad(0x1f0)](function(_0x2e8e16){const _0x461cdd=_0x1ebfad;if(_0x4fa59f['callRecordingEncryption']&&fs['existsSync'](_0x2e8e16[_0x461cdd(0x1ec)])){const _0x40a89f=util[_0x461cdd(0x1e8)]('%s.cypher',_0x2e8e16[_0x461cdd(0x1ec)]);return _0x3694d7[_0x461cdd(0x1e7)](_0x2e8e16['value'],_0x40a89f,config[_0x461cdd(0x1db)][_0x461cdd(0x1ed)])['then'](function(){const _0x49382b=_0x461cdd;return fs[_0x49382b(0x1ee)](_0x2e8e16['value']),logger[_0x49382b(0x1de)]('CreateVoiceRecording\x20file\x20encrypted'),_0x2e8e16;});}return _0x2e8e16;})[_0x1ebfad(0x1f0)](function(_0x4b4c07){const _0x245cef=_0x1ebfad;logger[_0x245cef(0x1de)](_0x245cef(0x1e3),_0x464ba0),logger[_0x245cef(0x1ea)](_0x245cef(0x1e3),_0x464ba0,JSON[_0x245cef(0x1ef)](_0x4b4c07)),_0x544aa4(_0x4b4c07);})[_0x1ebfad(0x1da)](function(_0xeaae0d){const _0x35e115=_0x1ebfad;logger[_0x35e115(0x1dd)]('CreateVoiceRecording',_0xeaae0d[_0x35e115(0x1eb)],_0x464ba0),_0x5b21d2(_0x5bd897[_0x35e115(0x1dd)](0x1f4,_0xeaae0d[_0x35e115(0x1eb)]));});});};
\ No newline at end of file
+const a927_0x4953=['format','body','findOne','message','UpdateVoiceRecording','rpc','raw','VoiceRecording','CreateVoiceRecording\x20file\x20encrypted','where','../../config/environment','error','info','CreateVoiceRecording','callRecordingEncryption','stringify','secrets','Setting','unlink','debug','existsSync','create','../../components/encryptor','options','value','then','catch','../../mysqldb'];(function(_0x1e2fd6,_0x13a79b){const _0x495394=function(_0x1cdc02){while(--_0x1cdc02){_0x1e2fd6['push'](_0x1e2fd6['shift']());}};_0x495394(++_0x13a79b);}(a927_0x4953,0x1c6));const a927_0x1cdc=function(_0x1e2fd6,_0x13a79b){_0x1e2fd6=_0x1e2fd6-0xce;let _0x495394=a927_0x4953[_0x1e2fd6];return _0x495394;};const a927_0xfb4863=a927_0x1cdc;'use strict';const util=require('util'),fs=require('fs'),db=require(a927_0xfb4863(0xe3))['db'],logger=require('../../config/logger')(a927_0xfb4863(0xe9)),config=require(a927_0xfb4863(0xd2));exports['UpdateVoiceRecording']=function(_0xd39f17){const _0x2ff4f0=this;return new Promise(function(_0x309d6f,_0x12a5a3){const _0x1e07ca=a927_0x1cdc;return db[_0x1e07ca(0xcf)]['update'](_0xd39f17[_0x1e07ca(0xe5)],{'raw':_0xd39f17[_0x1e07ca(0xdf)]?_0xd39f17[_0x1e07ca(0xdf)][_0x1e07ca(0xce)]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd39f17[_0x1e07ca(0xdf)]?_0xd39f17[_0x1e07ca(0xdf)][_0x1e07ca(0xd1)]||null:null,'attributes':_0xd39f17[_0x1e07ca(0xdf)]?_0xd39f17['options']['attributes']||null:null,'limit':_0xd39f17[_0x1e07ca(0xdf)]?_0xd39f17[_0x1e07ca(0xdf)]['limit']||null:null})[_0x1e07ca(0xe1)](function(_0x3182b4){const _0x514d62=_0x1e07ca;logger['info']('UpdateVoiceRecording',_0xd39f17),logger[_0x514d62(0xdb)](_0x514d62(0xe8),_0xd39f17,JSON[_0x514d62(0xd7)](_0x3182b4)),_0x309d6f(_0x3182b4);})['catch'](function(_0x260579){const _0x5245d3=_0x1e07ca;logger['error']('UpdateVoiceRecording',_0x260579[_0x5245d3(0xe7)],_0xd39f17),_0x12a5a3(_0x2ff4f0[_0x5245d3(0xd3)](0x1f4,_0x260579['message']));});});},exports[a927_0xfb4863(0xd5)]=function(_0x447847){const _0x12ab14=this;return new Promise(function(_0x31e0cb,_0x244453){const _0xe49b17=a927_0x1cdc,_0x40d794=require(_0xe49b17(0xde));let _0x33c3d3;return db[_0xe49b17(0xd9)][_0xe49b17(0xe6)]({'attributes':['id',_0xe49b17(0xd6)],'where':{'id':0x1},'raw':!![]})['then'](function(_0x5b1f5f){const _0x1a5240=_0xe49b17;return _0x33c3d3=_0x5b1f5f,db['VoiceRecording'][_0x1a5240(0xdd)](_0x447847['body']);})[_0xe49b17(0xe1)](function(_0x52a1e8){const _0x1c21fc=_0xe49b17;if(_0x33c3d3[_0x1c21fc(0xd6)]&&fs[_0x1c21fc(0xdc)](_0x52a1e8[_0x1c21fc(0xe0)])){const _0xc3370f=util[_0x1c21fc(0xe4)]('%s.cypher',_0x52a1e8[_0x1c21fc(0xe0)]);return _0x40d794['encryptFile'](_0x52a1e8[_0x1c21fc(0xe0)],_0xc3370f,config[_0x1c21fc(0xd8)]['recording'])['then'](function(){const _0x1820e3=_0x1c21fc;return fs[_0x1820e3(0xda)](_0x52a1e8['value']),logger['info'](_0x1820e3(0xd0)),_0x52a1e8;});}return _0x52a1e8;})['then'](function(_0x98c903){const _0x59d40f=_0xe49b17;logger[_0x59d40f(0xd4)](_0x59d40f(0xd5),_0x447847),logger[_0x59d40f(0xdb)](_0x59d40f(0xd5),_0x447847,JSON['stringify'](_0x98c903)),_0x31e0cb(_0x98c903);})[_0xe49b17(0xe2)](function(_0x5915dc){const _0xa3047c=_0xe49b17;logger['error']('CreateVoiceRecording',_0x5915dc[_0xa3047c(0xe7)],_0x447847),_0x244453(_0x12ab14[_0xa3047c(0xd3)](0x1f4,_0x5915dc[_0xa3047c(0xe7)]));});});};
\ No newline at end of file