Built motion from commit a9fb64cc6defd8fb3a5cc199221f878e91c0e969. Version 3.0.0...
[motion-next.git] / server / api / license / license.controller.js
index 3818ad0..bd36389 100644 (file)
@@ -1 +1 @@
-const a390_0x763a=['demo','api','../../config/license/util','intersection','body','fields','checkLicense','catch','sendStatus','License','index','status','findOne','name','model','../../mysqldb','key','../../components/parsers/qs','lodash','rawAttributes','error','attributes','options','stack','then','query','length','update','keys'];(function(_0x23f43b,_0x763ab0){const _0xc4b156=function(_0x2c2042){while(--_0x2c2042){_0x23f43b['push'](_0x23f43b['shift']());}};_0xc4b156(++_0x763ab0);}(a390_0x763a,0xf6));const a390_0xc4b1=function(_0x23f43b,_0x763ab0){_0x23f43b=_0x23f43b-0x0;let _0xc4b156=a390_0x763a[_0x23f43b];return _0xc4b156;};const _0x4952a8=a390_0xc4b1;'use strict';const _=require(_0x4952a8('0x4')),qs=require(_0x4952a8('0x3')),logger=require('../../config/logger')(_0x4952a8('0x10')),db=require(_0x4952a8('0x1'))['db'];function respondWithResult(_0x2c2042,_0x30de42){return _0x30de42=_0x30de42||0xc8,function(_0x288541){const _0x5f2630=a390_0xc4b1;if(_0x288541)return _0x2c2042[_0x5f2630('0x1a')](_0x30de42)['json'](_0x288541);};}function saveUpdates(_0x42fb0f){return function(_0xb073fd){if(_0xb073fd)return _0xb073fd['update'](_0x42fb0f)['then'](function(_0x1f731e){return _0x1f731e;});return null;};}function handleEntityNotFound(_0x4f7a99){return function(_0x3e3ea4){const _0x374edf=a390_0xc4b1;return!_0x3e3ea4&&_0x4f7a99[_0x374edf('0x17')](0x194),_0x3e3ea4;};}function handleError(_0x1ae6b1,_0x3492fa){return _0x3492fa=_0x3492fa||0x1f4,function(_0x4aad5b){const _0xfdaec2=a390_0xc4b1;logger[_0xfdaec2('0x6')](_0x4aad5b[_0xfdaec2('0x9')]),_0x4aad5b[_0xfdaec2('0x1c')]&&delete _0x4aad5b[_0xfdaec2('0x1c')],_0x1ae6b1[_0xfdaec2('0x1a')](_0x3492fa)['send'](_0x4aad5b);};}const utilLicense=require(_0x4952a8('0x11'));exports[_0x4952a8('0x19')]=function(_0x435125,_0x3fdd2a){const _0x1023bd=_0x4952a8;let _0x9947ba={'raw':!![],'where':{'id':0x1}};const _0xe2ca56={};return _0xe2ca56[_0x1023bd('0x0')]=_[_0x1023bd('0xe')](db[_0x1023bd('0x18')][_0x1023bd('0x5')]),_0xe2ca56[_0x1023bd('0xb')]=_[_0x1023bd('0xe')](_0x435125['query']),_0xe2ca56['filters']=_[_0x1023bd('0x12')](_0xe2ca56[_0x1023bd('0x0')],_0xe2ca56[_0x1023bd('0xb')]),_0x9947ba[_0x1023bd('0x7')]=_['intersection'](_0xe2ca56[_0x1023bd('0x0')],qs[_0x1023bd('0x14')](_0x435125['query'][_0x1023bd('0x14')])),_0x9947ba[_0x1023bd('0x7')]=_0x9947ba[_0x1023bd('0x7')][_0x1023bd('0xc')]?_0x9947ba[_0x1023bd('0x7')]:_0xe2ca56[_0x1023bd('0x0')],_0x9947ba=_['merge']({},_0x9947ba,_0x435125[_0x1023bd('0x8')]),utilLicense['getLicense'](_0x9947ba)[_0x1023bd('0xa')](respondWithResult(_0x3fdd2a,null))[_0x1023bd('0x16')](handleError(_0x3fdd2a,null));},exports[_0x4952a8('0xd')]=function(_0x439c09,_0x4d3f16){const _0x4baa6c=_0x4952a8;return _0x439c09[_0x4baa6c('0x13')]['id']&&delete _0x439c09[_0x4baa6c('0x13')]['id'],db[_0x4baa6c('0x18')][_0x4baa6c('0x1b')]({'where':{'id':_0x439c09['params']['id']}})['then'](handleEntityNotFound(_0x4d3f16,null))[_0x4baa6c('0xa')](function(_0x327cf3){const _0x4be368=_0x4baa6c,_0x11898c=_0x327cf3['get']({'plain':!![]});return utilLicense[_0x4be368('0x15')](_0x11898c,_0x439c09[_0x4be368('0x13')][_0x4be368('0x2')]);})[_0x4baa6c('0xa')](function(_0x2aa082){const _0x1bd096=_0x4baa6c;if(!_0x2aa082[_0x1bd096('0xf')])return saveUpdates(_0x439c09[_0x1bd096('0x13')],null);return _0x2aa082;})['then'](respondWithResult(_0x4d3f16,null))[_0x4baa6c('0x16')](handleError(_0x4d3f16,null));};
\ No newline at end of file
+const a390_0x371a=['lodash','findOne','filters','sendStatus','catch','getLicense','../../components/parsers/qs','error','demo','key','stack','model','../../config/logger','name','body','api','send','then','attributes','json','length','get','query','update','checkLicense','rawAttributes','License','intersection','fields','params'];(function(_0x50d6c3,_0x371a09){const _0x2e707e=function(_0x170630){while(--_0x170630){_0x50d6c3['push'](_0x50d6c3['shift']());}};_0x2e707e(++_0x371a09);}(a390_0x371a,0x147));const a390_0x2e70=function(_0x50d6c3,_0x371a09){_0x50d6c3=_0x50d6c3-0x0;let _0x2e707e=a390_0x371a[_0x50d6c3];return _0x2e707e;};const _0x720c7a=a390_0x2e70;'use strict';const _=require(_0x720c7a('0x3')),qs=require(_0x720c7a('0x9')),logger=require(_0x720c7a('0xf'))(_0x720c7a('0x12')),db=require('../../mysqldb')['db'];function respondWithResult(_0x170630,_0x1872a3){return _0x1872a3=_0x1872a3||0xc8,function(_0x3d1408){const _0x68b249=a390_0x2e70;if(_0x3d1408)return _0x170630['status'](_0x1872a3)[_0x68b249('0x16')](_0x3d1408);};}function saveUpdates(_0x49a5f3){return function(_0x173e23){const _0x28d750=a390_0x2e70;if(_0x173e23)return _0x173e23['update'](_0x49a5f3)[_0x28d750('0x14')](function(_0x228519){return _0x228519;});return null;};}function handleEntityNotFound(_0x8f0c21){return function(_0x1896ff){const _0x3001fa=a390_0x2e70;return!_0x1896ff&&_0x8f0c21[_0x3001fa('0x6')](0x194),_0x1896ff;};}function handleError(_0x4a7ab4,_0x101154){return _0x101154=_0x101154||0x1f4,function(_0x48b627){const _0x548297=a390_0x2e70;logger[_0x548297('0xa')](_0x48b627[_0x548297('0xd')]),_0x48b627[_0x548297('0x10')]&&delete _0x48b627[_0x548297('0x10')],_0x4a7ab4['status'](_0x101154)[_0x548297('0x13')](_0x48b627);};}const utilLicense=require('../../config/license/util');exports['index']=function(_0x43b54e,_0x5cb86a){const _0x3e9add=_0x720c7a;let _0x4d0db5={'raw':!![],'where':{'id':0x1}};const _0xcc255={};return _0xcc255[_0x3e9add('0xe')]=_['keys'](db['License'][_0x3e9add('0x1c')]),_0xcc255[_0x3e9add('0x19')]=_['keys'](_0x43b54e[_0x3e9add('0x19')]),_0xcc255[_0x3e9add('0x5')]=_['intersection'](_0xcc255[_0x3e9add('0xe')],_0xcc255[_0x3e9add('0x19')]),_0x4d0db5[_0x3e9add('0x15')]=_[_0x3e9add('0x0')](_0xcc255[_0x3e9add('0xe')],qs[_0x3e9add('0x1')](_0x43b54e[_0x3e9add('0x19')][_0x3e9add('0x1')])),_0x4d0db5['attributes']=_0x4d0db5['attributes'][_0x3e9add('0x17')]?_0x4d0db5['attributes']:_0xcc255['model'],_0x4d0db5=_['merge']({},_0x4d0db5,_0x43b54e['options']),utilLicense[_0x3e9add('0x8')](_0x4d0db5)[_0x3e9add('0x14')](respondWithResult(_0x5cb86a,null))[_0x3e9add('0x7')](handleError(_0x5cb86a,null));},exports[_0x720c7a('0x1a')]=function(_0x5d0714,_0x23d106){const _0x1c2f27=_0x720c7a;return _0x5d0714['body']['id']&&delete _0x5d0714['body']['id'],db[_0x1c2f27('0x1d')][_0x1c2f27('0x4')]({'where':{'id':_0x5d0714[_0x1c2f27('0x2')]['id']}})[_0x1c2f27('0x14')](handleEntityNotFound(_0x23d106,null))['then'](function(_0x5505f0){const _0x5a07dc=_0x1c2f27,_0x5e82f0=_0x5505f0[_0x5a07dc('0x18')]({'plain':!![]});return utilLicense[_0x5a07dc('0x1b')](_0x5e82f0,_0x5d0714[_0x5a07dc('0x11')][_0x5a07dc('0xc')]);})[_0x1c2f27('0x14')](function(_0x3980cf){const _0xaf1295=_0x1c2f27;if(!_0x3980cf[_0xaf1295('0xb')])return saveUpdates(_0x5d0714[_0xaf1295('0x11')],null);return _0x3980cf;})[_0x1c2f27('0x14')](respondWithResult(_0x23d106,null))[_0x1c2f27('0x7')](handleError(_0x23d106,null));};
\ No newline at end of file