Built motion from commit f738f9592c388b9f9eb3948f400a5c9d717a3561. Version 3.0.0...
[motion-next.git] / server / api / user / user.options.js
index 9af823f..657c6b6 100644 (file)
@@ -1 +1 @@
-const a778_0x1e6d=['models','WAV','includes','then','SIP/%s,,tTxX','from-sip','utf8','Dial','changed','exports','record','push','chanspy','VoiceChanSpy','users','util','name','format','join','context','system','auth','gsm','CDR(type)=%s','lodash','concat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','SIP/%s,,tTxXU(xcally-mixmonitor-context)','recordingFormat','destroy','length','VoiceExtension','wav','updatePassword','_XCALLY_MIXMONITOR_FORMAT=%s','password','merge','Set','options','CDR(type)=internal','resolve','StopMixMonitor','catch','bulkCreate','ChanSpy','extensionMonitor','%s%s','SIP/%s,%s','internal','updateMd5Password'];(function(_0x2214a0,_0x353527){const _0x1e6dc8=function(_0x311d38){while(--_0x311d38){_0x2214a0['push'](_0x2214a0['shift']());}};_0x1e6dc8(++_0x353527);}(a778_0x1e6d,0x13d));const a778_0x311d=function(_0x2214a0,_0x353527){_0x2214a0=_0x2214a0-0xa9;let _0x1e6dc8=a778_0x1e6d[_0x2214a0];return _0x1e6dc8;};const a778_0x526b02=a778_0x311d,_=require(a778_0x526b02(0xb0)),util=require(a778_0x526b02(0xd9)),{Op}=require('sequelize');function addUserApplication(_0x2641d0,_0x48efb5){const _0x4787fc=a778_0x526b02,_0x1adcbc=[_0x4787fc(0xb8),_0x4787fc(0xcb),_0x4787fc(0xae)],_0x51c17b={'context':_0x2641d0['context']||_0x4787fc(0xcf),'exten':_0x48efb5,'type':_0x4787fc(0xac),'isApp':![],'UserId':_0x2641d0['id']},_0x1f3704=[{'app':_0x4787fc(0xbd),'appdata':_0x4787fc(0xbf)}];_0x2641d0['extensionMonitor']&&_[_0x4787fc(0xcc)](_0x1adcbc,_0x2641d0[_0x4787fc(0xc5)])?(_0x1f3704[_0x4787fc(0xd5)]({'app':_0x4787fc(0xbd),'appdata':_0x4787fc(0xb2)}),_0x1f3704[_0x4787fc(0xd5)]({'app':_0x4787fc(0xbd),'appdata':util[_0x4787fc(0xa9)](_0x4787fc(0xba),_0x2641d0['extensionMonitor'])}),_0x1f3704[_0x4787fc(0xd5)]({'app':_0x4787fc(0xd1),'appdata':util[_0x4787fc(0xa9)](_0x4787fc(0xb3),_0x2641d0[_0x4787fc(0xda)])})):_0x1f3704[_0x4787fc(0xd5)]({'app':_0x4787fc(0xd1),'appdata':util[_0x4787fc(0xa9)](_0x4787fc(0xce),_0x2641d0['name'])});_0x1f3704[_0x4787fc(0xd5)]({'app':'Hangup'});for(let _0x32ce5a=0x0;_0x32ce5a<_0x1f3704[_0x4787fc(0xb6)];_0x32ce5a++){_0x1f3704[_0x32ce5a]['priority']=_0x32ce5a+0x1,_0x1f3704[_0x32ce5a]=_['defaults'](_0x1f3704[_0x32ce5a],_0x51c17b);}return _0x1f3704;}function addChanSpyApplications(_0x4b145d,_0x453754,_0x2e9bff){const _0x331961=a778_0x526b02,_0xa8250c={'context':_0x4b145d[_0x331961(0xab)]||'from-sip','type':_0x331961(0xac),'isApp':![],'UserId':_0x4b145d['id']},_0x121045=[];for(let _0xe56252=0x0,_0x570848=0x1;_0xe56252<_0x2e9bff[_0x331961(0xb6)];_0xe56252++,_0x570848=0x1){const _0x4c609f={'exten':util[_0x331961(0xa9)](_0x331961(0xc6),_0x2e9bff[_0xe56252]['prefix'],_0x453754),'ChanSpyId':_0x2e9bff[_0xe56252]['id']};_0x121045[_0x331961(0xd5)](_[_0x331961(0xbc)]({'app':'Set','appdata':util[_0x331961(0xa9)](_0x331961(0xaf),_0x331961(0xd6)),'priority':_0x570848++},_0xa8250c,_0x4c609f)),_0x2e9bff[_0xe56252][_0x331961(0xd4)]&&_0x121045['push'](_[_0x331961(0xbc)]({'app':'MixMonitor','appdata':util['format']('${UNIQUEID}.%s,ab',_0x2e9bff[_0xe56252][_0x331961(0xb4)]),'priority':_0x570848++},_0xa8250c,_0x4c609f)),_0x2e9bff[_0xe56252][_0x331961(0xad)]&&_0x121045['push'](_['merge']({'app':'Authenticate','appdata':_0x2e9bff[_0xe56252]['password'],'priority':_0x570848++},_0xa8250c,_0x4c609f)),_0x121045[_0x331961(0xd5)](_[_0x331961(0xbc)]({'app':_0x331961(0xc4),'appdata':util[_0x331961(0xa9)](_0x331961(0xc7),_0x4b145d[_0x331961(0xda)],_0x2e9bff[_0xe56252][_0x331961(0xbe)]?_0x2e9bff[_0xe56252][_0x331961(0xbe)][_0x331961(0xaa)](''):''),'priority':_0x570848++},_0xa8250c,_0x4c609f)),_0x2e9bff[_0xe56252]['record']&&_0x121045['push'](_['merge']({'app':_0x331961(0xc1),'priority':_0x570848++},_0xa8250c,_0x4c609f));}return _0x121045;}function getChanSpy(_0x4a3947,_0xa38226){return new Promise(function(_0x5d57c0,_0x20a6f0){const _0x4242b1=a778_0x311d;return _0x4a3947[_0x4242b1(0xd7)]['findAll']()[_0x4242b1(0xcd)](function(_0x3b5801){const _0x3de244=_0x4242b1;if(_0x3b5801){let _0x1b164a=addChanSpyApplications(_0xa38226,_0xa38226[_0x3de244(0xc8)],_0x3b5801);return _0xa38226[_0x3de244(0xc8)]!=_0xa38226[_0x3de244(0xda)]&&(_0x1b164a=_0x1b164a['concat'](addChanSpyApplications(_0xa38226,_0xa38226[_0x3de244(0xda)],_0x3b5801))),_0x5d57c0(_0x1b164a);}return _0x5d57c0([]);})[_0x4242b1(0xc2)](function(_0x415340){_0x20a6f0(_0x415340);});});}function options(_0x508187){const _0x17e1f7=a778_0x526b02;return{'sequelize':_0x508187,'tableName':_0x17e1f7(0xd8),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2573d2){return _0x2573d2['updateMd5Password'](),_0x2573d2['updatePassword']();},'beforeUpdate':function(_0x3d11ba){const _0x4282b0=_0x17e1f7;return _0x3d11ba[_0x4282b0(0xd2)](_0x4282b0(0xbb))?(_0x3d11ba[_0x4282b0(0xc9)](),_0x3d11ba[_0x4282b0(0xb9)]()):Promise[_0x4282b0(0xc0)]();},'afterCreate':function(_0x15ee43){const _0xb99acc=_0x17e1f7,_0x4adcb6=_0x508187[_0xb99acc(0xca)];let _0x114127=addUserApplication(_0x15ee43,_0x15ee43['internal']);return _0x15ee43[_0xb99acc(0xc8)]!=_0x15ee43['name']&&(_0x114127=_0x114127[_0xb99acc(0xb1)](addUserApplication(_0x15ee43,_0x15ee43[_0xb99acc(0xda)]))),_0x4adcb6[_0xb99acc(0xb7)][_0xb99acc(0xc3)](_0x114127)['then'](function(){const _0x5d4cad=_0xb99acc;if(_0x15ee43[_0x5d4cad(0xd6)])return getChanSpy(_0x4adcb6,_0x15ee43);})['then'](function(_0x18396a){const _0x51c506=_0xb99acc;return _0x18396a&&_0x18396a[_0x51c506(0xb6)]?_0x4adcb6[_0x51c506(0xb7)]['bulkCreate'](_0x18396a):null;})[_0xb99acc(0xc2)](function(_0x59f2b6){return _0x59f2b6;});},'afterUpdate':function(_0x2a5f13){const _0x368354=_0x17e1f7,_0x35cdca=_0x508187[_0x368354(0xca)];return Promise[_0x368354(0xc0)]()[_0x368354(0xcd)](function(){const _0x4a18c4=_0x368354;if(_0x2a5f13[_0x4a18c4(0xd2)](_0x4a18c4(0xd6))||_0x2a5f13['changed'](_0x4a18c4(0xab)))return _0x35cdca[_0x4a18c4(0xb7)][_0x4a18c4(0xb5)]({'where':{'UserId':_0x2a5f13['id'],'type':_0x4a18c4(0xac),'ChanSpyId':{[Op['ne']]:null}}})[_0x4a18c4(0xcd)](function(){const _0x48a964=_0x4a18c4;if(_0x2a5f13[_0x48a964(0xd6)])return getChanSpy(_0x35cdca,_0x2a5f13)[_0x48a964(0xcd)](function(_0x24328f){const _0x443c07=_0x48a964;if(_0x24328f&&_0x24328f[_0x443c07(0xb6)])return _0x35cdca[_0x443c07(0xb7)][_0x443c07(0xc3)](_0x24328f);});});})[_0x368354(0xcd)](function(){const _0x1cac6e=_0x368354;return _0x2a5f13[_0x1cac6e(0xd2)](_0x1cac6e(0xc5))||_0x2a5f13['changed'](_0x1cac6e(0xab))?_0x35cdca['VoiceExtension'][_0x1cac6e(0xb5)]({'where':{'UserId':_0x2a5f13['id'],'type':_0x1cac6e(0xac),'ChanSpyId':null}})[_0x1cac6e(0xcd)](function(){const _0x9a225b=_0x1cac6e;let _0x6179ae=addUserApplication(_0x2a5f13,_0x2a5f13[_0x9a225b(0xc8)]);return _0x2a5f13[_0x9a225b(0xc8)]!=_0x2a5f13['name']&&(_0x6179ae=_0x6179ae[_0x9a225b(0xb1)](addUserApplication(_0x2a5f13,_0x2a5f13['name']))),_0x35cdca[_0x9a225b(0xb7)][_0x9a225b(0xc3)](_0x6179ae);}):null;})['catch'](function(_0x16df71){return _0x16df71;});},'afterDestroy':function(_0x1b457d){const _0x445eb5=_0x17e1f7,_0x5463db=_0x508187[_0x445eb5(0xca)];return _0x5463db[_0x445eb5(0xb7)][_0x445eb5(0xb5)]({'where':{'UserId':_0x1b457d['id'],'type':'system'}});}},'charset':_0x17e1f7(0xd0),'collate':'utf8_bin'};}module[a778_0x526b02(0xd3)][a778_0x526b02(0xbe)]=options;
\ No newline at end of file
+const a778_0x522d=['%s%s','ChanSpy','name','SIP/%s,,tTxX','CDR(type)=internal','recordingFormat','${UNIQUEID}.%s,ab','join','destroy','then','password','system','extensionMonitor','exports','auth','SIP/%s,,tTxXU(xcally-mixmonitor-context)','push','gsm','Set','chanspy','VoiceExtension','length','Dial','wav','CDR(type)=%s','record','Authenticate','findAll','updatePassword','defaults','merge','internal','options','from-sip','context','prefix','_XCALLY_MIXMONITOR_FORMAT=%s','Hangup','changed','models','VoiceChanSpy','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','priority','users','includes','StopMixMonitor','utf8_bin','format','utf8','concat'];(function(_0x27f27d,_0x2dfd72){const _0x522d5c=function(_0x3175e7){while(--_0x3175e7){_0x27f27d['push'](_0x27f27d['shift']());}};_0x522d5c(++_0x2dfd72);}(a778_0x522d,0x17e));const a778_0x3175=function(_0x27f27d,_0x2dfd72){_0x27f27d=_0x27f27d-0x15a;let _0x522d5c=a778_0x522d[_0x27f27d];return _0x522d5c;};const a778_0x2110a1=a778_0x3175,_=require('lodash'),util=require('util'),{Op}=require('sequelize');function addUserApplication(_0xc2b288,_0x580ac0){const _0x48173a=a778_0x3175,_0x1d5b02=[_0x48173a(0x183),'WAV',_0x48173a(0x17d)],_0x5124cb={'context':_0xc2b288[_0x48173a(0x15c)]||'from-sip','exten':_0x580ac0,'type':'system','isApp':![],'UserId':_0xc2b288['id']},_0x1b41fd=[{'app':_0x48173a(0x17e),'appdata':_0x48173a(0x170)}];_0xc2b288[_0x48173a(0x178)]&&_[_0x48173a(0x166)](_0x1d5b02,_0xc2b288[_0x48173a(0x178)])?(_0x1b41fd['push']({'app':_0x48173a(0x17e),'appdata':_0x48173a(0x163)}),_0x1b41fd[_0x48173a(0x17c)]({'app':_0x48173a(0x17e),'appdata':util[_0x48173a(0x169)](_0x48173a(0x15e),_0xc2b288[_0x48173a(0x178)])}),_0x1b41fd['push']({'app':_0x48173a(0x182),'appdata':util['format'](_0x48173a(0x17b),_0xc2b288[_0x48173a(0x16e)])})):_0x1b41fd[_0x48173a(0x17c)]({'app':_0x48173a(0x182),'appdata':util[_0x48173a(0x169)](_0x48173a(0x16f),_0xc2b288[_0x48173a(0x16e)])});_0x1b41fd[_0x48173a(0x17c)]({'app':_0x48173a(0x15f)});for(let _0x54c94b=0x0;_0x54c94b<_0x1b41fd[_0x48173a(0x181)];_0x54c94b++){_0x1b41fd[_0x54c94b][_0x48173a(0x164)]=_0x54c94b+0x1,_0x1b41fd[_0x54c94b]=_[_0x48173a(0x189)](_0x1b41fd[_0x54c94b],_0x5124cb);}return _0x1b41fd;}function addChanSpyApplications(_0x52af4b,_0x54187b,_0x317f4b){const _0x5c2670=a778_0x3175,_0x21e189={'context':_0x52af4b[_0x5c2670(0x15c)]||_0x5c2670(0x15b),'type':_0x5c2670(0x177),'isApp':![],'UserId':_0x52af4b['id']},_0x1993b1=[];for(let _0x4c0797=0x0,_0x1d289e=0x1;_0x4c0797<_0x317f4b['length'];_0x4c0797++,_0x1d289e=0x1){const _0xcd22f2={'exten':util[_0x5c2670(0x169)](_0x5c2670(0x16c),_0x317f4b[_0x4c0797][_0x5c2670(0x15d)],_0x54187b),'ChanSpyId':_0x317f4b[_0x4c0797]['id']};_0x1993b1[_0x5c2670(0x17c)](_[_0x5c2670(0x18a)]({'app':_0x5c2670(0x17e),'appdata':util[_0x5c2670(0x169)](_0x5c2670(0x184),_0x5c2670(0x17f)),'priority':_0x1d289e++},_0x21e189,_0xcd22f2)),_0x317f4b[_0x4c0797][_0x5c2670(0x185)]&&_0x1993b1[_0x5c2670(0x17c)](_[_0x5c2670(0x18a)]({'app':'MixMonitor','appdata':util[_0x5c2670(0x169)](_0x5c2670(0x172),_0x317f4b[_0x4c0797][_0x5c2670(0x171)]),'priority':_0x1d289e++},_0x21e189,_0xcd22f2)),_0x317f4b[_0x4c0797][_0x5c2670(0x17a)]&&_0x1993b1[_0x5c2670(0x17c)](_['merge']({'app':_0x5c2670(0x186),'appdata':_0x317f4b[_0x4c0797][_0x5c2670(0x176)],'priority':_0x1d289e++},_0x21e189,_0xcd22f2)),_0x1993b1[_0x5c2670(0x17c)](_[_0x5c2670(0x18a)]({'app':_0x5c2670(0x16d),'appdata':util[_0x5c2670(0x169)]('SIP/%s,%s',_0x52af4b[_0x5c2670(0x16e)],_0x317f4b[_0x4c0797][_0x5c2670(0x15a)]?_0x317f4b[_0x4c0797]['options'][_0x5c2670(0x173)](''):''),'priority':_0x1d289e++},_0x21e189,_0xcd22f2)),_0x317f4b[_0x4c0797][_0x5c2670(0x185)]&&_0x1993b1[_0x5c2670(0x17c)](_[_0x5c2670(0x18a)]({'app':_0x5c2670(0x167),'priority':_0x1d289e++},_0x21e189,_0xcd22f2));}return _0x1993b1;}function getChanSpy(_0x31efa3,_0x4b8fdd){return new Promise(function(_0x54453c,_0x483eac){const _0x5c3074=a778_0x3175;return _0x31efa3[_0x5c3074(0x162)][_0x5c3074(0x187)]()[_0x5c3074(0x175)](function(_0x4d0ee1){const _0x48f7e8=_0x5c3074;if(_0x4d0ee1){let _0x497c78=addChanSpyApplications(_0x4b8fdd,_0x4b8fdd[_0x48f7e8(0x18b)],_0x4d0ee1);return _0x4b8fdd['internal']!=_0x4b8fdd['name']&&(_0x497c78=_0x497c78[_0x48f7e8(0x16b)](addChanSpyApplications(_0x4b8fdd,_0x4b8fdd[_0x48f7e8(0x16e)],_0x4d0ee1))),_0x54453c(_0x497c78);}return _0x54453c([]);})['catch'](function(_0x2e4b4c){_0x483eac(_0x2e4b4c);});});}function options(_0x4a8727){const _0x1077c9=a778_0x3175;return{'sequelize':_0x4a8727,'tableName':_0x1077c9(0x165),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x58e448){return _0x58e448['updateMd5Password'](),_0x58e448['updatePassword']();},'beforeUpdate':function(_0x5735a3){const _0x1fc06f=_0x1077c9;return _0x5735a3['changed'](_0x1fc06f(0x176))?(_0x5735a3['updateMd5Password'](),_0x5735a3[_0x1fc06f(0x188)]()):Promise['resolve']();},'afterCreate':function(_0x2b7a5f){const _0x217ad0=_0x1077c9,_0x282ebb=_0x4a8727[_0x217ad0(0x161)];let _0xf3ad1f=addUserApplication(_0x2b7a5f,_0x2b7a5f[_0x217ad0(0x18b)]);return _0x2b7a5f['internal']!=_0x2b7a5f[_0x217ad0(0x16e)]&&(_0xf3ad1f=_0xf3ad1f['concat'](addUserApplication(_0x2b7a5f,_0x2b7a5f[_0x217ad0(0x16e)]))),_0x282ebb[_0x217ad0(0x180)]['bulkCreate'](_0xf3ad1f)['then'](function(){const _0x4360ed=_0x217ad0;if(_0x2b7a5f[_0x4360ed(0x17f)])return getChanSpy(_0x282ebb,_0x2b7a5f);})[_0x217ad0(0x175)](function(_0x3d0f4d){const _0x31a653=_0x217ad0;return _0x3d0f4d&&_0x3d0f4d['length']?_0x282ebb[_0x31a653(0x180)]['bulkCreate'](_0x3d0f4d):null;})['catch'](function(_0xce95cd){return _0xce95cd;});},'afterUpdate':function(_0x5b221d){const _0x265056=_0x1077c9,_0x3825e9=_0x4a8727[_0x265056(0x161)];return Promise['resolve']()[_0x265056(0x175)](function(){const _0x5c2adc=_0x265056;if(_0x5b221d['changed']('chanspy')||_0x5b221d[_0x5c2adc(0x160)]('context'))return _0x3825e9[_0x5c2adc(0x180)][_0x5c2adc(0x174)]({'where':{'UserId':_0x5b221d['id'],'type':_0x5c2adc(0x177),'ChanSpyId':{[Op['ne']]:null}}})[_0x5c2adc(0x175)](function(){const _0x4d64eb=_0x5c2adc;if(_0x5b221d[_0x4d64eb(0x17f)])return getChanSpy(_0x3825e9,_0x5b221d)[_0x4d64eb(0x175)](function(_0x453c6c){const _0x514059=_0x4d64eb;if(_0x453c6c&&_0x453c6c[_0x514059(0x181)])return _0x3825e9['VoiceExtension']['bulkCreate'](_0x453c6c);});});})[_0x265056(0x175)](function(){const _0x330a71=_0x265056;return _0x5b221d[_0x330a71(0x160)]('extensionMonitor')||_0x5b221d['changed'](_0x330a71(0x15c))?_0x3825e9[_0x330a71(0x180)]['destroy']({'where':{'UserId':_0x5b221d['id'],'type':'system','ChanSpyId':null}})['then'](function(){const _0x399adc=_0x330a71;let _0x4f1771=addUserApplication(_0x5b221d,_0x5b221d[_0x399adc(0x18b)]);return _0x5b221d[_0x399adc(0x18b)]!=_0x5b221d['name']&&(_0x4f1771=_0x4f1771[_0x399adc(0x16b)](addUserApplication(_0x5b221d,_0x5b221d[_0x399adc(0x16e)]))),_0x3825e9['VoiceExtension']['bulkCreate'](_0x4f1771);}):null;})['catch'](function(_0x321aa2){return _0x321aa2;});},'afterDestroy':function(_0x1b6c18){const _0x5ab2ff=_0x1077c9,_0x33b5a8=_0x4a8727[_0x5ab2ff(0x161)];return _0x33b5a8[_0x5ab2ff(0x180)][_0x5ab2ff(0x174)]({'where':{'UserId':_0x1b6c18['id'],'type':_0x5ab2ff(0x177)}});}},'charset':_0x1077c9(0x16a),'collate':_0x1077c9(0x168)};}module[a778_0x2110a1(0x179)]['options']=options;
\ No newline at end of file