Built motion from commit b517aaa2a6638133380e4d135c64a80893061362. Version 3.0.0...
[motion-next.git] / server / api / license / license.controller.js
index 5689100..40ef177 100644 (file)
@@ -1 +1 @@
-const a390_0x30b7=['then','keys','stack','params','../../config/logger','key','getLicense','License','fields','../../components/parsers/qs','checkLicense','demo','merge','filters','status','error','attributes','body','update','index','lodash','name','model','length','intersection','query','findOne','../../config/license/util','../../mysqldb','catch','send'];(function(_0x20ab00,_0x30b744){const _0x55ed4a=function(_0x24a0b0){while(--_0x24a0b0){_0x20ab00['push'](_0x20ab00['shift']());}};_0x55ed4a(++_0x30b744);}(a390_0x30b7,0x88));const a390_0x55ed=function(_0x20ab00,_0x30b744){_0x20ab00=_0x20ab00-0x0;let _0x55ed4a=a390_0x30b7[_0x20ab00];return _0x55ed4a;};const _0x2fe50f=a390_0x55ed;'use strict';const _=require(_0x2fe50f('0x8')),qs=require(_0x2fe50f('0x1c')),logger=require(_0x2fe50f('0x17'))('api'),db=require(_0x2fe50f('0x10'))['db'];function respondWithResult(_0x24a0b0,_0xd7d952){return _0xd7d952=_0xd7d952||0xc8,function(_0x30adb0){const _0x1c1c03=a390_0x55ed;if(_0x30adb0)return _0x24a0b0[_0x1c1c03('0x2')](_0xd7d952)['json'](_0x30adb0);};}function saveUpdates(_0x35b0aa){return function(_0x378e20){const _0x288bf9=a390_0x55ed;if(_0x378e20)return _0x378e20[_0x288bf9('0x6')](_0x35b0aa)[_0x288bf9('0x13')](function(_0x218a2d){return _0x218a2d;});return null;};}function handleEntityNotFound(_0x22dd06){return function(_0x17439b){return!_0x17439b&&_0x22dd06['sendStatus'](0x194),_0x17439b;};}function handleError(_0x4a6c62,_0x458574){return _0x458574=_0x458574||0x1f4,function(_0x27136f){const _0x404c3e=a390_0x55ed;logger[_0x404c3e('0x3')](_0x27136f[_0x404c3e('0x15')]),_0x27136f[_0x404c3e('0x9')]&&delete _0x27136f['name'],_0x4a6c62[_0x404c3e('0x2')](_0x458574)[_0x404c3e('0x12')](_0x27136f);};}const utilLicense=require(_0x2fe50f('0xf'));exports[_0x2fe50f('0x7')]=function(_0x2cbf1b,_0x5ae026){const _0x10f6a2=_0x2fe50f;let _0x10f6dc={'raw':!![],'where':{'id':0x1}};const _0x438232={};return _0x438232[_0x10f6a2('0xa')]=_['keys'](db['License']['rawAttributes']),_0x438232[_0x10f6a2('0xd')]=_[_0x10f6a2('0x14')](_0x2cbf1b[_0x10f6a2('0xd')]),_0x438232[_0x10f6a2('0x1')]=_[_0x10f6a2('0xc')](_0x438232[_0x10f6a2('0xa')],_0x438232[_0x10f6a2('0xd')]),_0x10f6dc[_0x10f6a2('0x4')]=_['intersection'](_0x438232[_0x10f6a2('0xa')],qs[_0x10f6a2('0x1b')](_0x2cbf1b[_0x10f6a2('0xd')][_0x10f6a2('0x1b')])),_0x10f6dc[_0x10f6a2('0x4')]=_0x10f6dc[_0x10f6a2('0x4')][_0x10f6a2('0xb')]?_0x10f6dc[_0x10f6a2('0x4')]:_0x438232['model'],_0x10f6dc=_[_0x10f6a2('0x0')]({},_0x10f6dc,_0x2cbf1b['options']),utilLicense[_0x10f6a2('0x19')](_0x10f6dc)[_0x10f6a2('0x13')](respondWithResult(_0x5ae026,null))[_0x10f6a2('0x11')](handleError(_0x5ae026,null));},exports['update']=function(_0x29564b,_0x44279b){const _0x48d08d=_0x2fe50f;return _0x29564b[_0x48d08d('0x5')]['id']&&delete _0x29564b['body']['id'],db[_0x48d08d('0x1a')][_0x48d08d('0xe')]({'where':{'id':_0x29564b[_0x48d08d('0x16')]['id']}})[_0x48d08d('0x13')](handleEntityNotFound(_0x44279b,null))[_0x48d08d('0x13')](function(_0x1789ee){const _0x8f6b2=_0x48d08d,_0x5463eb=_0x1789ee['get']({'plain':!![]});return utilLicense[_0x8f6b2('0x1d')](_0x5463eb,_0x29564b[_0x8f6b2('0x5')][_0x8f6b2('0x18')]);})['then'](function(_0x1ca951){const _0xc050d1=_0x48d08d;if(!_0x1ca951[_0xc050d1('0x1e')])return saveUpdates(_0x29564b[_0xc050d1('0x5')],null);return _0x1ca951;})[_0x48d08d('0x13')](respondWithResult(_0x44279b,null))['catch'](handleError(_0x44279b,null));};
\ No newline at end of file
+const a390_0x5ab3=['model','body','catch','stack','intersection','options','length','update','json','get','send','params','keys','name','checkLicense','License','lodash','fields','sendStatus','../../config/license/util','demo','filters','attributes','query','merge','getLicense','then'];(function(_0x48a5f5,_0x5ab35a){const _0x3bd168=function(_0x3115ba){while(--_0x3115ba){_0x48a5f5['push'](_0x48a5f5['shift']());}};_0x3bd168(++_0x5ab35a);}(a390_0x5ab3,0x1ab));const a390_0x3bd1=function(_0x48a5f5,_0x5ab35a){_0x48a5f5=_0x48a5f5-0x0;let _0x3bd168=a390_0x5ab3[_0x48a5f5];return _0x3bd168;};const _0xec08a6=a390_0x3bd1;'use strict';const _=require(_0xec08a6('0x15')),qs=require('../../components/parsers/qs'),logger=require('../../config/logger')('api'),db=require('../../mysqldb')['db'];function respondWithResult(_0x3115ba,_0xd5fd73){return _0xd5fd73=_0xd5fd73||0xc8,function(_0x54ab96){const _0x119e89=a390_0x3bd1;if(_0x54ab96)return _0x3115ba['status'](_0xd5fd73)[_0x119e89('0xd')](_0x54ab96);};}function saveUpdates(_0x5bc030){return function(_0x30464d){const _0x211ca5=a390_0x3bd1;if(_0x30464d)return _0x30464d[_0x211ca5('0xc')](_0x5bc030)['then'](function(_0x52ac87){return _0x52ac87;});return null;};}function handleEntityNotFound(_0x5d9e05){return function(_0x1dd53d){const _0x29cc8b=a390_0x3bd1;return!_0x1dd53d&&_0x5d9e05[_0x29cc8b('0x17')](0x194),_0x1dd53d;};}function handleError(_0x2f0151,_0x55b3d5){return _0x55b3d5=_0x55b3d5||0x1f4,function(_0x1cfdb0){const _0xacd8d4=a390_0x3bd1;logger['error'](_0x1cfdb0[_0xacd8d4('0x8')]),_0x1cfdb0[_0xacd8d4('0x12')]&&delete _0x1cfdb0['name'],_0x2f0151['status'](_0x55b3d5)[_0xacd8d4('0xf')](_0x1cfdb0);};}const utilLicense=require(_0xec08a6('0x18'));exports['index']=function(_0x5263cd,_0x168fa9){const _0x181a86=_0xec08a6;let _0x12f952={'raw':!![],'where':{'id':0x1}};const _0x43f003={};return _0x43f003[_0x181a86('0x5')]=_['keys'](db[_0x181a86('0x14')]['rawAttributes']),_0x43f003[_0x181a86('0x1')]=_[_0x181a86('0x11')](_0x5263cd['query']),_0x43f003[_0x181a86('0x1a')]=_[_0x181a86('0x9')](_0x43f003[_0x181a86('0x5')],_0x43f003[_0x181a86('0x1')]),_0x12f952[_0x181a86('0x0')]=_['intersection'](_0x43f003[_0x181a86('0x5')],qs[_0x181a86('0x16')](_0x5263cd[_0x181a86('0x1')][_0x181a86('0x16')])),_0x12f952[_0x181a86('0x0')]=_0x12f952[_0x181a86('0x0')][_0x181a86('0xb')]?_0x12f952[_0x181a86('0x0')]:_0x43f003[_0x181a86('0x5')],_0x12f952=_[_0x181a86('0x2')]({},_0x12f952,_0x5263cd[_0x181a86('0xa')]),utilLicense[_0x181a86('0x3')](_0x12f952)[_0x181a86('0x4')](respondWithResult(_0x168fa9,null))['catch'](handleError(_0x168fa9,null));},exports[_0xec08a6('0xc')]=function(_0x4937a5,_0x5810fd){const _0x56fb52=_0xec08a6;return _0x4937a5['body']['id']&&delete _0x4937a5[_0x56fb52('0x6')]['id'],db['License']['findOne']({'where':{'id':_0x4937a5[_0x56fb52('0x10')]['id']}})[_0x56fb52('0x4')](handleEntityNotFound(_0x5810fd,null))[_0x56fb52('0x4')](function(_0x542654){const _0x57ef33=_0x56fb52,_0x2933a6=_0x542654[_0x57ef33('0xe')]({'plain':!![]});return utilLicense[_0x57ef33('0x13')](_0x2933a6,_0x4937a5[_0x57ef33('0x6')]['key']);})[_0x56fb52('0x4')](function(_0x4ece53){const _0x32dbbc=_0x56fb52;if(!_0x4ece53[_0x32dbbc('0x19')])return saveUpdates(_0x4937a5[_0x32dbbc('0x6')],null);return _0x4ece53;})['then'](respondWithResult(_0x5810fd,null))[_0x56fb52('0x7')](handleError(_0x5810fd,null));};
\ No newline at end of file