Built motion from commit (unavailable).|2.5.18
[motion2.git] / server / api / variable / variable.controller.js
index 36ce7db..d46e4dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c75=['type','key','model','name','intersection','attributes','fields','length','nolimit','limit','query','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','rawAttributes','catch','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','html-pdf','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','json','count','offset','Content-Range','apply','save','update','then','destroy','get','Variables','sendStatus','error','stack','send','map','Variable','fieldName'];(function(_0x32f74a,_0x58cfab){var _0x3efbdf=function(_0x21a6b0){while(--_0x21a6b0){_0x32f74a['push'](_0x32f74a['shift']());}};_0x3efbdf(++_0x58cfab);}(_0x4c75,0x1ba));var _0x54c7=function(_0x40bdb3,_0x5a81f2){_0x40bdb3=_0x40bdb3-0x0;var _0xeac086=_0x4c75[_0x40bdb3];return _0xeac086;};'use strict';var pdf=require(_0x54c7('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x54c7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x54c7('0x2'));var moment=require('moment');var BPromise=require(_0x54c7('0x3'));var Mustache=require(_0x54c7('0x4'));var util=require(_0x54c7('0x5'));var path=require(_0x54c7('0x6'));var sox=require(_0x54c7('0x7'));var csv=require(_0x54c7('0x8'));var ejs=require(_0x54c7('0x9'));var fs=require('fs');var _=require(_0x54c7('0xa'));var squel=require(_0x54c7('0xb'));var crypto=require(_0x54c7('0xc'));var jsforce=require(_0x54c7('0xd'));var deskjs=require(_0x54c7('0xe'));var toCsv=require(_0x54c7('0x8'));var querystring=require(_0x54c7('0xf'));var Papa=require(_0x54c7('0x10'));var Redis=require(_0x54c7('0x11'));var authService=require(_0x54c7('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x54c7('0x13'));var hardwareService=require(_0x54c7('0x14'));var logger=require(_0x54c7('0x15'))(_0x54c7('0x16'));var utils=require(_0x54c7('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x386455,_0x1be0ea){_0x1be0ea=_0x1be0ea||0xcc;return function(_0x43c4bd){if(_0x43c4bd){return _0x386455['sendStatus'](_0x1be0ea);}return _0x386455[_0x54c7('0x18')](_0x1be0ea)[_0x54c7('0x19')]();};}function respondWithResult(_0x57ce9f,_0x4aa3b7){_0x4aa3b7=_0x4aa3b7||0xc8;return function(_0x4ec18f){if(_0x4ec18f){return _0x57ce9f[_0x54c7('0x18')](_0x4aa3b7)[_0x54c7('0x1a')](_0x4ec18f);}};}function respondWithFilteredResult(_0x190480,_0x40cd89){return function(_0x5e50f9){if(_0x5e50f9){var _0x145568=_0x5e50f9[_0x54c7('0x1b')],_0x3d3cb7=_0x40cd89[_0x54c7('0x1c')],_0x3a7304=_0x40cd89['offset']+_0x40cd89['limit'],_0x86b644;if(_0x3a7304>=_0x145568){_0x3a7304=_0x145568;_0x86b644=0xc8;}else{_0x86b644=0xce;}_0x190480[_0x54c7('0x18')](_0x86b644);return _0x190480['set'](_0x54c7('0x1d'),_0x3d3cb7+'-'+_0x3a7304+'/'+_0x145568)[_0x54c7('0x1a')](_0x5e50f9);}return null;};}function patchUpdates(_0x124f94){return function(_0x4996a9){try{jsonpatch[_0x54c7('0x1e')](_0x4996a9,_0x124f94,!![]);}catch(_0x35a5f7){return BPromise['reject'](_0x35a5f7);}return _0x4996a9[_0x54c7('0x1f')]();};}function saveUpdates(_0x4d2425,_0x4398a2){return function(_0x41141f){if(_0x41141f){return _0x41141f[_0x54c7('0x20')](_0x4d2425)[_0x54c7('0x21')](function(_0x54c117){return _0x54c117;});}return null;};}function removeEntity(_0x59ce45,_0x2afbf2){return function(_0xd2bd5c){if(_0xd2bd5c){return _0xd2bd5c[_0x54c7('0x22')]()['then'](function(){var _0xe87609=_0xd2bd5c[_0x54c7('0x23')]({'plain':!![]});var _0x588d6d=_0x54c7('0x24');return db['UserProfileResource'][_0x54c7('0x22')]({'where':{'type':_0x588d6d,'resourceId':_0xe87609['id']}})[_0x54c7('0x21')](function(){return _0xd2bd5c;});})[_0x54c7('0x21')](function(){_0x59ce45[_0x54c7('0x18')](0xcc)[_0x54c7('0x19')]();});}};}function handleEntityNotFound(_0x530398,_0x56afc5){return function(_0x517e23){if(!_0x517e23){_0x530398[_0x54c7('0x25')](0x194);}return _0x517e23;};}function handleError(_0x229a5b,_0x12c144){_0x12c144=_0x12c144||0x1f4;return function(_0x527d94){logger[_0x54c7('0x26')](_0x527d94[_0x54c7('0x27')]);if(_0x527d94['name']){delete _0x527d94['name'];}_0x229a5b[_0x54c7('0x18')](_0x12c144)[_0x54c7('0x28')](_0x527d94);};}exports['index']=function(_0x5e9358,_0x560a4f){var _0x2a751c={},_0x972e31={},_0x2b8639={'count':0x0,'rows':[]};var _0x3b5829=_[_0x54c7('0x29')](db[_0x54c7('0x2a')]['rawAttributes'],function(_0x13c2c5){return{'name':_0x13c2c5[_0x54c7('0x2b')],'type':_0x13c2c5[_0x54c7('0x2c')][_0x54c7('0x2d')]};});_0x972e31[_0x54c7('0x2e')]=_[_0x54c7('0x29')](_0x3b5829,_0x54c7('0x2f'));_0x972e31['query']=_['keys'](_0x5e9358['query']);_0x972e31['filters']=_[_0x54c7('0x30')](_0x972e31[_0x54c7('0x2e')],_0x972e31['query']);_0x2a751c[_0x54c7('0x31')]=_[_0x54c7('0x30')](_0x972e31[_0x54c7('0x2e')],qs[_0x54c7('0x32')](_0x5e9358['query'][_0x54c7('0x32')]));_0x2a751c[_0x54c7('0x31')]=_0x2a751c['attributes'][_0x54c7('0x33')]?_0x2a751c[_0x54c7('0x31')]:_0x972e31[_0x54c7('0x2e')];if(!_0x5e9358['query']['hasOwnProperty'](_0x54c7('0x34'))){_0x2a751c[_0x54c7('0x35')]=qs[_0x54c7('0x35')](_0x5e9358[_0x54c7('0x36')][_0x54c7('0x35')]);_0x2a751c[_0x54c7('0x1c')]=qs[_0x54c7('0x1c')](_0x5e9358['query'][_0x54c7('0x1c')]);}_0x2a751c[_0x54c7('0x37')]=qs[_0x54c7('0x38')](_0x5e9358['query'][_0x54c7('0x38')]);_0x2a751c[_0x54c7('0x39')]=qs[_0x54c7('0x3a')](_[_0x54c7('0x3b')](_0x5e9358[_0x54c7('0x36')],_0x972e31['filters']),_0x3b5829);if(_0x5e9358[_0x54c7('0x36')][_0x54c7('0x3c')]){_0x2a751c[_0x54c7('0x39')]=_[_0x54c7('0x3d')](_0x2a751c[_0x54c7('0x39')],{'$or':_[_0x54c7('0x29')](_0x3b5829,function(_0x2210cd){if(_0x2210cd['type']!==_0x54c7('0x3e')){var _0x57911b={};_0x57911b[_0x2210cd[_0x54c7('0x2f')]]={'$like':'%'+_0x5e9358[_0x54c7('0x36')]['filter']+'%'};return _0x57911b;}})});}_0x2a751c=_[_0x54c7('0x3d')]({},_0x2a751c,_0x5e9358[_0x54c7('0x3f')]);var _0x45cb52={'where':_0x2a751c['where']};return db['Variable'][_0x54c7('0x1b')](_0x45cb52)[_0x54c7('0x21')](function(_0x17a5b7){_0x2b8639['count']=_0x17a5b7;if(_0x5e9358[_0x54c7('0x36')][_0x54c7('0x40')]){_0x2a751c[_0x54c7('0x41')]=[{'all':!![]}];}return db['Variable'][_0x54c7('0x42')](_0x2a751c);})[_0x54c7('0x21')](function(_0x4f075d){_0x2b8639[_0x54c7('0x43')]=_0x4f075d;return _0x2b8639;})[_0x54c7('0x21')](respondWithFilteredResult(_0x560a4f,_0x2a751c))['catch'](handleError(_0x560a4f,null));};exports[_0x54c7('0x44')]=function(_0x8a9c52,_0x3bda8b){var _0x2ccd1d={'raw':!![],'where':{'id':_0x8a9c52[_0x54c7('0x45')]['id']}},_0xe04faf={};_0xe04faf['model']=_[_0x54c7('0x46')](db[_0x54c7('0x2a')][_0x54c7('0x47')]);_0xe04faf[_0x54c7('0x36')]=_[_0x54c7('0x46')](_0x8a9c52[_0x54c7('0x36')]);_0xe04faf[_0x54c7('0x3a')]=_[_0x54c7('0x30')](_0xe04faf[_0x54c7('0x2e')],_0xe04faf[_0x54c7('0x36')]);_0x2ccd1d[_0x54c7('0x31')]=_['intersection'](_0xe04faf[_0x54c7('0x2e')],qs[_0x54c7('0x32')](_0x8a9c52['query'][_0x54c7('0x32')]));_0x2ccd1d['attributes']=_0x2ccd1d[_0x54c7('0x31')][_0x54c7('0x33')]?_0x2ccd1d[_0x54c7('0x31')]:_0xe04faf[_0x54c7('0x2e')];if(_0x8a9c52[_0x54c7('0x36')][_0x54c7('0x40')]){_0x2ccd1d['include']=[{'all':!![]}];}_0x2ccd1d=_[_0x54c7('0x3d')]({},_0x2ccd1d,_0x8a9c52[_0x54c7('0x3f')]);return db[_0x54c7('0x2a')]['find'](_0x2ccd1d)[_0x54c7('0x21')](handleEntityNotFound(_0x3bda8b,null))[_0x54c7('0x21')](respondWithResult(_0x3bda8b,null))[_0x54c7('0x48')](handleError(_0x3bda8b,null));};exports['create']=function(_0x410aff,_0x5df538){return db[_0x54c7('0x2a')]['create'](_0x410aff['body'],{})['then'](function(_0x5b6d37){var _0xd938ea=_0x410aff[_0x54c7('0x49')][_0x54c7('0x23')]({'plain':!![]});if(!_0xd938ea)throw new Error(_0x54c7('0x4a'));if(_0xd938ea[_0x54c7('0x4b')]===_0x54c7('0x49')){var _0x9d0bf6=_0x5b6d37[_0x54c7('0x23')]({'plain':!![]});var _0x3c67f8=_0x54c7('0x24');return db['UserProfileSection'][_0x54c7('0x4c')]({'where':{'name':_0x3c67f8,'userProfileId':_0xd938ea[_0x54c7('0x4d')]},'raw':!![]})[_0x54c7('0x21')](function(_0x437521){if(_0x437521&&_0x437521['autoAssociation']===0x0){return db['UserProfileResource'][_0x54c7('0x4e')]({'name':_0x9d0bf6[_0x54c7('0x2f')],'resourceId':_0x9d0bf6['id'],'type':_0x437521[_0x54c7('0x2f')],'sectionId':_0x437521['id']},{})[_0x54c7('0x21')](function(){return _0x5b6d37;});}else{return _0x5b6d37;}})[_0x54c7('0x48')](function(_0x3271ec){logger[_0x54c7('0x26')](_0x54c7('0x4f'),_0x3271ec);throw _0x3271ec;});}return _0x5b6d37;})[_0x54c7('0x21')](respondWithResult(_0x5df538,0xc9))['catch'](handleError(_0x5df538,null));};exports[_0x54c7('0x20')]=function(_0x51be51,_0x4f8c76){if(_0x51be51[_0x54c7('0x50')]['id']){delete _0x51be51['body']['id'];}return db['Variable'][_0x54c7('0x4c')]({'where':{'id':_0x51be51[_0x54c7('0x45')]['id']}})[_0x54c7('0x21')](handleEntityNotFound(_0x4f8c76,null))['then'](saveUpdates(_0x51be51[_0x54c7('0x50')],null))['then'](respondWithResult(_0x4f8c76,null))[_0x54c7('0x48')](handleError(_0x4f8c76,null));};exports[_0x54c7('0x22')]=function(_0x14de24,_0x337181){return db[_0x54c7('0x2a')][_0x54c7('0x4c')]({'where':{'id':_0x14de24[_0x54c7('0x45')]['id']}})[_0x54c7('0x21')](handleEntityNotFound(_0x337181,null))[_0x54c7('0x21')](removeEntity(_0x337181,null))['catch'](handleError(_0x337181,null));};
\ No newline at end of file
+var _0x02bb=['error','stack','name','map','Variable','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','count','findAll','rows','catch','show','params','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','rimraf','fast-json-patch','mustache','to-csv','lodash','squel','crypto','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Variables'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0x02bb,0xc0));var _0xb02b=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x02bb[_0x4565bf];return _0x5610ba;};'use strict';var pdf=require(_0xb02b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb02b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb02b('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb02b('0x3'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xb02b('0x4'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb02b('0x5'));var squel=require(_0xb02b('0x6'));var crypto=require(_0xb02b('0x7'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb02b('0x8'));var qs=require(_0xb02b('0x9'));var as=require(_0xb02b('0xa'));var hardwareService=require(_0xb02b('0xb'));var logger=require('../../config/logger')(_0xb02b('0xc'));var utils=require(_0xb02b('0xd'));var config=require(_0xb02b('0xe'));var licenseUtil=require(_0xb02b('0xf'));var db=require(_0xb02b('0x10'))['db'];function respondWithStatusCode(_0x2958fd,_0x17fe03){_0x17fe03=_0x17fe03||0xcc;return function(_0x53c3f9){if(_0x53c3f9){return _0x2958fd[_0xb02b('0x11')](_0x17fe03);}return _0x2958fd[_0xb02b('0x12')](_0x17fe03)[_0xb02b('0x13')]();};}function respondWithResult(_0x452429,_0x110016){_0x110016=_0x110016||0xc8;return function(_0x521e1c){if(_0x521e1c){return _0x452429[_0xb02b('0x12')](_0x110016)[_0xb02b('0x14')](_0x521e1c);}};}function respondWithFilteredResult(_0x57011b,_0x4b0dc9){return function(_0x1db812){if(_0x1db812){var _0x1ea8d2=_0x1db812['count'],_0x2d076c=_0x4b0dc9[_0xb02b('0x15')],_0x391fff=_0x4b0dc9['offset']+_0x4b0dc9[_0xb02b('0x16')],_0x58d30f;if(_0x391fff>=_0x1ea8d2){_0x391fff=_0x1ea8d2;_0x58d30f=0xc8;}else{_0x58d30f=0xce;}_0x57011b[_0xb02b('0x12')](_0x58d30f);return _0x57011b[_0xb02b('0x17')](_0xb02b('0x18'),_0x2d076c+'-'+_0x391fff+'/'+_0x1ea8d2)[_0xb02b('0x14')](_0x1db812);}return null;};}function patchUpdates(_0x271f41){return function(_0x599c51){try{jsonpatch[_0xb02b('0x19')](_0x599c51,_0x271f41,!![]);}catch(_0x2c4c06){return BPromise[_0xb02b('0x1a')](_0x2c4c06);}return _0x599c51[_0xb02b('0x1b')]();};}function saveUpdates(_0x4f8c1e,_0x2ebb7f){return function(_0x498743){if(_0x498743){return _0x498743[_0xb02b('0x1c')](_0x4f8c1e)[_0xb02b('0x1d')](function(_0x37182b){return _0x37182b;});}return null;};}function removeEntity(_0x4a9974,_0x294a50){return function(_0x283d6f){if(_0x283d6f){return _0x283d6f[_0xb02b('0x1e')]()[_0xb02b('0x1d')](function(){var _0x20fa45=_0x283d6f[_0xb02b('0x1f')]({'plain':!![]});var _0x313ae4=_0xb02b('0x20');return db['UserProfileResource']['destroy']({'where':{'type':_0x313ae4,'resourceId':_0x20fa45['id']}})[_0xb02b('0x1d')](function(){return _0x283d6f;});})[_0xb02b('0x1d')](function(){_0x4a9974[_0xb02b('0x12')](0xcc)[_0xb02b('0x13')]();});}};}function handleEntityNotFound(_0x24e969,_0x414432){return function(_0x4e0181){if(!_0x4e0181){_0x24e969['sendStatus'](0x194);}return _0x4e0181;};}function handleError(_0x5dd87c,_0x35cf9b){_0x35cf9b=_0x35cf9b||0x1f4;return function(_0x3521e5){logger[_0xb02b('0x21')](_0x3521e5[_0xb02b('0x22')]);if(_0x3521e5[_0xb02b('0x23')]){delete _0x3521e5[_0xb02b('0x23')];}_0x5dd87c[_0xb02b('0x12')](_0x35cf9b)['send'](_0x3521e5);};}exports['index']=function(_0x457e8a,_0x4e43e1){var _0x418b24={},_0x1c43b5={},_0x58891a={'count':0x0,'rows':[]};var _0x940069=_[_0xb02b('0x24')](db[_0xb02b('0x25')][_0xb02b('0x26')],function(_0x3b7a94){return{'name':_0x3b7a94[_0xb02b('0x27')],'type':_0x3b7a94[_0xb02b('0x28')][_0xb02b('0x29')]};});_0x1c43b5[_0xb02b('0x2a')]=_[_0xb02b('0x24')](_0x940069,'name');_0x1c43b5[_0xb02b('0x2b')]=_[_0xb02b('0x2c')](_0x457e8a[_0xb02b('0x2b')]);_0x1c43b5[_0xb02b('0x2d')]=_[_0xb02b('0x2e')](_0x1c43b5[_0xb02b('0x2a')],_0x1c43b5[_0xb02b('0x2b')]);_0x418b24[_0xb02b('0x2f')]=_['intersection'](_0x1c43b5[_0xb02b('0x2a')],qs[_0xb02b('0x30')](_0x457e8a[_0xb02b('0x2b')][_0xb02b('0x30')]));_0x418b24[_0xb02b('0x2f')]=_0x418b24['attributes'][_0xb02b('0x31')]?_0x418b24[_0xb02b('0x2f')]:_0x1c43b5['model'];if(!_0x457e8a[_0xb02b('0x2b')][_0xb02b('0x32')](_0xb02b('0x33'))){_0x418b24[_0xb02b('0x16')]=qs[_0xb02b('0x16')](_0x457e8a[_0xb02b('0x2b')][_0xb02b('0x16')]);_0x418b24[_0xb02b('0x15')]=qs['offset'](_0x457e8a[_0xb02b('0x2b')][_0xb02b('0x15')]);}_0x418b24[_0xb02b('0x34')]=qs[_0xb02b('0x35')](_0x457e8a[_0xb02b('0x2b')][_0xb02b('0x35')]);_0x418b24[_0xb02b('0x36')]=qs[_0xb02b('0x2d')](_['pick'](_0x457e8a[_0xb02b('0x2b')],_0x1c43b5[_0xb02b('0x2d')]),_0x940069);if(_0x457e8a[_0xb02b('0x2b')][_0xb02b('0x37')]){_0x418b24[_0xb02b('0x36')]=_['merge'](_0x418b24[_0xb02b('0x36')],{'$or':_[_0xb02b('0x24')](_0x940069,function(_0x4f7a61){if(_0x4f7a61[_0xb02b('0x28')]!==_0xb02b('0x38')){var _0xd2ef1e={};_0xd2ef1e[_0x4f7a61[_0xb02b('0x23')]]={'$like':'%'+_0x457e8a[_0xb02b('0x2b')][_0xb02b('0x37')]+'%'};return _0xd2ef1e;}})});}_0x418b24=_[_0xb02b('0x39')]({},_0x418b24,_0x457e8a[_0xb02b('0x3a')]);var _0x5b28bc={'where':_0x418b24['where']};return db['Variable'][_0xb02b('0x3b')](_0x5b28bc)[_0xb02b('0x1d')](function(_0x5868d9){_0x58891a['count']=_0x5868d9;if(_0x457e8a[_0xb02b('0x2b')]['includeAll']){_0x418b24['include']=[{'all':!![]}];}return db[_0xb02b('0x25')][_0xb02b('0x3c')](_0x418b24);})[_0xb02b('0x1d')](function(_0x2a85aa){_0x58891a[_0xb02b('0x3d')]=_0x2a85aa;return _0x58891a;})[_0xb02b('0x1d')](respondWithFilteredResult(_0x4e43e1,_0x418b24))[_0xb02b('0x3e')](handleError(_0x4e43e1,null));};exports[_0xb02b('0x3f')]=function(_0x1b46f2,_0x1c1336){var _0x128a11={'raw':!![],'where':{'id':_0x1b46f2[_0xb02b('0x40')]['id']}},_0x57a500={};_0x57a500[_0xb02b('0x2a')]=_[_0xb02b('0x2c')](db[_0xb02b('0x25')]['rawAttributes']);_0x57a500[_0xb02b('0x2b')]=_[_0xb02b('0x2c')](_0x1b46f2['query']);_0x57a500[_0xb02b('0x2d')]=_[_0xb02b('0x2e')](_0x57a500[_0xb02b('0x2a')],_0x57a500['query']);_0x128a11['attributes']=_[_0xb02b('0x2e')](_0x57a500[_0xb02b('0x2a')],qs[_0xb02b('0x30')](_0x1b46f2['query'][_0xb02b('0x30')]));_0x128a11[_0xb02b('0x2f')]=_0x128a11[_0xb02b('0x2f')]['length']?_0x128a11[_0xb02b('0x2f')]:_0x57a500[_0xb02b('0x2a')];if(_0x1b46f2[_0xb02b('0x2b')][_0xb02b('0x41')]){_0x128a11[_0xb02b('0x42')]=[{'all':!![]}];}_0x128a11=_[_0xb02b('0x39')]({},_0x128a11,_0x1b46f2[_0xb02b('0x3a')]);return db[_0xb02b('0x25')][_0xb02b('0x43')](_0x128a11)[_0xb02b('0x1d')](handleEntityNotFound(_0x1c1336,null))[_0xb02b('0x1d')](respondWithResult(_0x1c1336,null))[_0xb02b('0x3e')](handleError(_0x1c1336,null));};exports[_0xb02b('0x44')]=function(_0x591ab7,_0x5e1638){return db[_0xb02b('0x25')][_0xb02b('0x44')](_0x591ab7[_0xb02b('0x45')],{})[_0xb02b('0x1d')](function(_0x559965){var _0x2807c7=_0x591ab7[_0xb02b('0x46')][_0xb02b('0x1f')]({'plain':!![]});if(!_0x2807c7)throw new Error(_0xb02b('0x47'));if(_0x2807c7['role']===_0xb02b('0x46')){var _0x3378b4=_0x559965['get']({'plain':!![]});var _0x4c24cd=_0xb02b('0x20');return db[_0xb02b('0x48')][_0xb02b('0x43')]({'where':{'name':_0x4c24cd,'userProfileId':_0x2807c7['userProfileId']},'raw':!![]})[_0xb02b('0x1d')](function(_0x35837e){if(_0x35837e&&_0x35837e[_0xb02b('0x49')]===0x0){return db['UserProfileResource'][_0xb02b('0x44')]({'name':_0x3378b4[_0xb02b('0x23')],'resourceId':_0x3378b4['id'],'type':_0x35837e[_0xb02b('0x23')],'sectionId':_0x35837e['id']},{})['then'](function(){return _0x559965;});}else{return _0x559965;}})[_0xb02b('0x3e')](function(_0xc55c89){logger[_0xb02b('0x21')](_0xb02b('0x4a'),_0xc55c89);throw _0xc55c89;});}return _0x559965;})[_0xb02b('0x1d')](respondWithResult(_0x5e1638,0xc9))[_0xb02b('0x3e')](handleError(_0x5e1638,null));};exports[_0xb02b('0x1c')]=function(_0x1fdb5e,_0x5c655f){if(_0x1fdb5e['body']['id']){delete _0x1fdb5e[_0xb02b('0x45')]['id'];}return db['Variable'][_0xb02b('0x43')]({'where':{'id':_0x1fdb5e[_0xb02b('0x40')]['id']}})[_0xb02b('0x1d')](handleEntityNotFound(_0x5c655f,null))[_0xb02b('0x1d')](saveUpdates(_0x1fdb5e[_0xb02b('0x45')],null))[_0xb02b('0x1d')](respondWithResult(_0x5c655f,null))[_0xb02b('0x3e')](handleError(_0x5c655f,null));};exports['destroy']=function(_0x57eb0d,_0x9f484d){return db['Variable'][_0xb02b('0x43')]({'where':{'id':_0x57eb0d[_0xb02b('0x40')]['id']}})['then'](handleEntityNotFound(_0x9f484d,null))[_0xb02b('0x1d')](removeEntity(_0x9f484d,null))[_0xb02b('0x3e')](handleError(_0x9f484d,null));};
\ No newline at end of file