Built motion from commit df3e9871f6bcc3432fec345b2f4facbd4dba8b5c. Version 3.0.0...
[motion-next.git] / server / api / license / license.controller.js
index 87d9174..5961c2d 100644 (file)
@@ -1 +1 @@
-const a390_0x2b4f=['params','query','options','getLicense','filters','body','then','attributes','../../mysqldb','update','status','get','stack','../../config/license/util','length','rawAttributes','lodash','model','checkLicense','fields','intersection','api','License','findOne','json','keys','name','demo'];(function(_0x540ce1,_0x2b4fd4){const _0x2913b1=function(_0x32520b){while(--_0x32520b){_0x540ce1['push'](_0x540ce1['shift']());}};_0x2913b1(++_0x2b4fd4);}(a390_0x2b4f,0x169));const a390_0x2913=function(_0x540ce1,_0x2b4fd4){_0x540ce1=_0x540ce1-0x0;let _0x2913b1=a390_0x2b4f[_0x540ce1];return _0x2913b1;};const _0xe81ef9=a390_0x2913;'use strict';const _=require(_0xe81ef9('0x13')),qs=require('../../components/parsers/qs'),logger=require('../../config/logger')(_0xe81ef9('0x18')),db=require(_0xe81ef9('0xb'))['db'];function respondWithResult(_0x32520b,_0x108583){return _0x108583=_0x108583||0xc8,function(_0x2adb94){const _0x1db811=a390_0x2913;if(_0x2adb94)return _0x32520b['status'](_0x108583)[_0x1db811('0x1b')](_0x2adb94);};}function saveUpdates(_0x415325){return function(_0x231022){const _0x595e5e=a390_0x2913;if(_0x231022)return _0x231022[_0x595e5e('0xc')](_0x415325)[_0x595e5e('0x9')](function(_0x39c3c8){return _0x39c3c8;});return null;};}function handleEntityNotFound(_0x9d923c){return function(_0x3749de){return!_0x3749de&&_0x9d923c['sendStatus'](0x194),_0x3749de;};}function handleError(_0x5276dc,_0x1b3547){return _0x1b3547=_0x1b3547||0x1f4,function(_0x434b01){const _0x330542=a390_0x2913;logger['error'](_0x434b01[_0x330542('0xf')]),_0x434b01['name']&&delete _0x434b01[_0x330542('0x1')],_0x5276dc[_0x330542('0xd')](_0x1b3547)['send'](_0x434b01);};}const utilLicense=require(_0xe81ef9('0x10'));exports['index']=function(_0x413e96,_0x3cec61){const _0x4dabb9=_0xe81ef9;let _0x2c36be={'raw':!![],'where':{'id':0x1}};const _0x3e35ef={};return _0x3e35ef[_0x4dabb9('0x14')]=_[_0x4dabb9('0x0')](db[_0x4dabb9('0x19')][_0x4dabb9('0x12')]),_0x3e35ef[_0x4dabb9('0x4')]=_[_0x4dabb9('0x0')](_0x413e96[_0x4dabb9('0x4')]),_0x3e35ef[_0x4dabb9('0x7')]=_['intersection'](_0x3e35ef['model'],_0x3e35ef[_0x4dabb9('0x4')]),_0x2c36be[_0x4dabb9('0xa')]=_[_0x4dabb9('0x17')](_0x3e35ef[_0x4dabb9('0x14')],qs[_0x4dabb9('0x16')](_0x413e96['query']['fields'])),_0x2c36be['attributes']=_0x2c36be[_0x4dabb9('0xa')][_0x4dabb9('0x11')]?_0x2c36be['attributes']:_0x3e35ef[_0x4dabb9('0x14')],_0x2c36be=_['merge']({},_0x2c36be,_0x413e96[_0x4dabb9('0x5')]),utilLicense[_0x4dabb9('0x6')](_0x2c36be)['then'](respondWithResult(_0x3cec61,null))['catch'](handleError(_0x3cec61,null));},exports['update']=function(_0x557001,_0x179827){const _0x2aed31=_0xe81ef9;return _0x557001[_0x2aed31('0x8')]['id']&&delete _0x557001[_0x2aed31('0x8')]['id'],db[_0x2aed31('0x19')][_0x2aed31('0x1a')]({'where':{'id':_0x557001[_0x2aed31('0x3')]['id']}})['then'](handleEntityNotFound(_0x179827,null))[_0x2aed31('0x9')](function(_0x5771e7){const _0x207a88=_0x2aed31,_0x35f09d=_0x5771e7[_0x207a88('0xe')]({'plain':!![]});return utilLicense[_0x207a88('0x15')](_0x35f09d,_0x557001['body']['key']);})[_0x2aed31('0x9')](function(_0x4dbd05){const _0x41ac81=_0x2aed31;if(!_0x4dbd05[_0x41ac81('0x2')])return saveUpdates(_0x557001[_0x41ac81('0x8')],null);return _0x4dbd05;})[_0x2aed31('0x9')](respondWithResult(_0x179827,null))['catch'](handleError(_0x179827,null));};
\ No newline at end of file
+const a390_0x21b3=['../../mysqldb','filters','model','update','keys','../../config/license/util','send','../../components/parsers/qs','intersection','name','merge','params','License','getLicense','status','checkLicense','query','demo','body','error','fields','attributes','stack','findOne','../../config/logger','then','options','json','length'];(function(_0x2e488e,_0x21b33b){const _0x487d1c=function(_0x27f4a2){while(--_0x27f4a2){_0x2e488e['push'](_0x2e488e['shift']());}};_0x487d1c(++_0x21b33b);}(a390_0x21b3,0x1d0));const a390_0x487d=function(_0x2e488e,_0x21b33b){_0x2e488e=_0x2e488e-0x0;let _0x487d1c=a390_0x21b3[_0x2e488e];return _0x487d1c;};const _0x49da42=a390_0x487d;'use strict';const _=require('lodash'),qs=require(_0x49da42('0x7')),logger=require(_0x49da42('0x18'))('api'),db=require(_0x49da42('0x0'))['db'];function respondWithResult(_0x27f4a2,_0x338083){return _0x338083=_0x338083||0xc8,function(_0x55a534){const _0x5141f0=a390_0x487d;if(_0x55a534)return _0x27f4a2[_0x5141f0('0xe')](_0x338083)[_0x5141f0('0x1b')](_0x55a534);};}function saveUpdates(_0x512797){return function(_0x5c109e){const _0x3e1054=a390_0x487d;if(_0x5c109e)return _0x5c109e[_0x3e1054('0x3')](_0x512797)['then'](function(_0x578372){return _0x578372;});return null;};}function handleEntityNotFound(_0x3ae90f){return function(_0x569e92){return!_0x569e92&&_0x3ae90f['sendStatus'](0x194),_0x569e92;};}function handleError(_0x4a216b,_0x5e5bb9){return _0x5e5bb9=_0x5e5bb9||0x1f4,function(_0x83e9f2){const _0x411666=a390_0x487d;logger[_0x411666('0x13')](_0x83e9f2[_0x411666('0x16')]),_0x83e9f2[_0x411666('0x9')]&&delete _0x83e9f2[_0x411666('0x9')],_0x4a216b[_0x411666('0xe')](_0x5e5bb9)[_0x411666('0x6')](_0x83e9f2);};}const utilLicense=require(_0x49da42('0x5'));exports['index']=function(_0x30277c,_0x466915){const _0x33e614=_0x49da42;let _0x82f5ba={'raw':!![],'where':{'id':0x1}};const _0x2271ad={};return _0x2271ad[_0x33e614('0x2')]=_[_0x33e614('0x4')](db[_0x33e614('0xc')]['rawAttributes']),_0x2271ad[_0x33e614('0x10')]=_[_0x33e614('0x4')](_0x30277c['query']),_0x2271ad[_0x33e614('0x1')]=_[_0x33e614('0x8')](_0x2271ad['model'],_0x2271ad['query']),_0x82f5ba['attributes']=_[_0x33e614('0x8')](_0x2271ad[_0x33e614('0x2')],qs[_0x33e614('0x14')](_0x30277c['query']['fields'])),_0x82f5ba['attributes']=_0x82f5ba['attributes'][_0x33e614('0x1c')]?_0x82f5ba[_0x33e614('0x15')]:_0x2271ad[_0x33e614('0x2')],_0x82f5ba=_[_0x33e614('0xa')]({},_0x82f5ba,_0x30277c[_0x33e614('0x1a')]),utilLicense[_0x33e614('0xd')](_0x82f5ba)[_0x33e614('0x19')](respondWithResult(_0x466915,null))['catch'](handleError(_0x466915,null));},exports[_0x49da42('0x3')]=function(_0x330a8b,_0x14e9e5){const _0x4b6763=_0x49da42;return _0x330a8b[_0x4b6763('0x12')]['id']&&delete _0x330a8b[_0x4b6763('0x12')]['id'],db[_0x4b6763('0xc')][_0x4b6763('0x17')]({'where':{'id':_0x330a8b[_0x4b6763('0xb')]['id']}})[_0x4b6763('0x19')](handleEntityNotFound(_0x14e9e5,null))[_0x4b6763('0x19')](function(_0x2656e0){const _0x3cf47a=_0x4b6763,_0x11bc09=_0x2656e0['get']({'plain':!![]});return utilLicense[_0x3cf47a('0xf')](_0x11bc09,_0x330a8b['body']['key']);})[_0x4b6763('0x19')](function(_0x5d72c1){const _0x572eed=_0x4b6763;if(!_0x5d72c1[_0x572eed('0x11')])return saveUpdates(_0x330a8b[_0x572eed('0x12')],null);return _0x5d72c1;})[_0x4b6763('0x19')](respondWithResult(_0x14e9e5,null))['catch'](handleError(_0x14e9e5,null));};
\ No newline at end of file