Built motion from commit f861bcb808219e66da88ba48b61bddb35224a65e. Version 3.0.0...
[motion-next.git] / server / api / license / license.controller.js
1 'use strict';const a470_0x6cad=['api','getLicense','model','error','index','License','findOne','1144623bKbuUB','json','name','update','@config/license/util','query','stack','demo','catch','options','180287tEuaXf','542482DMqACq','checkLicense','key','@components/parsers/qs','keys','fields','5VUsSCN','@config/logger','410761treqEK','sendStatus','attributes','send','then','status','body','params','1puEpNE','1TXCXKZ','lodash','@mysqldb','32GBxgNx','119319Jxznyv','intersection','938762JFGEwy','29085JKfUEQ'];const a470_0x11dc=function(_0x9f7e54,_0x469940){_0x9f7e54=_0x9f7e54-0x118;let _0x6cad16=a470_0x6cad[_0x9f7e54];return _0x6cad16;};const a470_0x5509f9=a470_0x11dc;(function(_0x3c881a,_0x1fa8b9){const _0x406fcd=a470_0x11dc;while(!![]){try{const _0x20bd5b=-parseInt(_0x406fcd(0x133))*parseInt(_0x406fcd(0x12f))+parseInt(_0x406fcd(0x130))*parseInt(_0x406fcd(0x121))+parseInt(_0x406fcd(0x13b))+parseInt(_0x406fcd(0x12b))*parseInt(_0x406fcd(0x11b))+parseInt(_0x406fcd(0x123))+-parseInt(_0x406fcd(0x11a))+parseInt(_0x406fcd(0x12c))*-parseInt(_0x406fcd(0x132));if(_0x20bd5b===_0x1fa8b9)break;else _0x3c881a['push'](_0x3c881a['shift']());}catch(_0x5ac296){_0x3c881a['push'](_0x3c881a['shift']());}}}(a470_0x6cad,0x9d654));const _=require(a470_0x5509f9(0x12d)),qs=require(a470_0x5509f9(0x11e)),logger=require(a470_0x5509f9(0x122))(a470_0x5509f9(0x134)),{db}=require(a470_0x5509f9(0x12e));function respondWithResult(_0x3452d3,_0x43968d){return _0x43968d=_0x43968d||0xc8,function(_0x5b0360){const _0x177b94=a470_0x11dc;if(_0x5b0360)return _0x3452d3[_0x177b94(0x128)](_0x43968d)[_0x177b94(0x13c)](_0x5b0360);};}function saveUpdates(_0x54d4e7){return function(_0x1ab6d1){const _0x516d5f=a470_0x11dc;if(_0x1ab6d1)return _0x1ab6d1[_0x516d5f(0x13e)](_0x54d4e7)[_0x516d5f(0x127)](function(_0x16f33d){return _0x16f33d;});return null;};}function handleEntityNotFound(_0x189e52){return function(_0x1f92cd){const _0x1a2289=a470_0x11dc;return!_0x1f92cd&&_0x189e52[_0x1a2289(0x124)](0x194),_0x1f92cd;};}function handleError(_0x722407,_0x22f3d6){return _0x22f3d6=_0x22f3d6||0x1f4,function(_0x4bd1a8){const _0x1d2473=a470_0x11dc;logger[_0x1d2473(0x137)](_0x4bd1a8[_0x1d2473(0x141)]),_0x4bd1a8[_0x1d2473(0x13d)]&&delete _0x4bd1a8[_0x1d2473(0x13d)],_0x722407[_0x1d2473(0x128)](_0x22f3d6)[_0x1d2473(0x126)](_0x4bd1a8);};}const utilLicense=require(a470_0x5509f9(0x13f));exports[a470_0x5509f9(0x138)]=function(_0x278804,_0x526463){const _0xdd0e58=a470_0x5509f9;let _0x5a01fe={'raw':!![],'where':{'id':0x1}};const _0x317fae={};return _0x317fae[_0xdd0e58(0x136)]=_['keys'](db['License']['rawAttributes']),_0x317fae[_0xdd0e58(0x140)]=_[_0xdd0e58(0x11f)](_0x278804['query']),_0x317fae['filters']=_[_0xdd0e58(0x131)](_0x317fae[_0xdd0e58(0x136)],_0x317fae[_0xdd0e58(0x140)]),_0x5a01fe[_0xdd0e58(0x125)]=_['intersection'](_0x317fae[_0xdd0e58(0x136)],qs[_0xdd0e58(0x120)](_0x278804[_0xdd0e58(0x140)]['fields'])),_0x5a01fe[_0xdd0e58(0x125)]=_0x5a01fe[_0xdd0e58(0x125)]['length']?_0x5a01fe[_0xdd0e58(0x125)]:_0x317fae[_0xdd0e58(0x136)],_0x5a01fe=_['merge']({},_0x5a01fe,_0x278804[_0xdd0e58(0x119)]),utilLicense[_0xdd0e58(0x135)](_0x5a01fe)[_0xdd0e58(0x127)](respondWithResult(_0x526463,null))[_0xdd0e58(0x118)](handleError(_0x526463,null));},exports[a470_0x5509f9(0x13e)]=function(_0x44600b,_0xb44b5){const _0x9681d3=a470_0x5509f9;return _0x44600b[_0x9681d3(0x129)]['id']&&delete _0x44600b[_0x9681d3(0x129)]['id'],db[_0x9681d3(0x139)][_0x9681d3(0x13a)]({'where':{'id':_0x44600b[_0x9681d3(0x12a)]['id']}})[_0x9681d3(0x127)](handleEntityNotFound(_0xb44b5,null))[_0x9681d3(0x127)](function(_0x83d5fe){const _0x4d235c=_0x9681d3,_0x211bf9=_0x83d5fe['get']({'plain':!![]});return utilLicense[_0x4d235c(0x11c)](_0x211bf9,_0x44600b[_0x4d235c(0x129)][_0x4d235c(0x11d)]);})[_0x9681d3(0x127)](function(_0x214126){const _0xbfd861=_0x9681d3;if(!_0x214126[_0xbfd861(0x142)])return saveUpdates(_0x44600b[_0xbfd861(0x129)],null);return _0x214126;})[_0x9681d3(0x127)](respondWithResult(_0xb44b5,null))[_0x9681d3(0x118)](handleError(_0xb44b5,null));};