Built motion from commit (unavailable).|2.5.26
[motion2.git] / server / api / schedule / schedule.controller.js
index 784f74f..c25f8c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x427f=['rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','order','where','pick','filter','type','VIRTUAL','merge','options','Schedule','includeAll','include','findAll','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','../../config/schedule','run','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','count','offset','limit','apply','reject','destroy','then','get','Scheduler','UserProfileResource','stack','name','send','index','map'];(function(_0x3f88ad,_0x18abcf){var _0x121e2d=function(_0x228db2){while(--_0x228db2){_0x3f88ad['push'](_0x3f88ad['shift']());}};_0x121e2d(++_0x18abcf);}(_0x427f,0xc7));var _0xf427=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x427f[_0x501510];return _0x1e6ee5;};'use strict';var pdf=require(_0xf427('0x0'));var emlformat=require(_0xf427('0x1'));var rimraf=require(_0xf427('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf427('0x3'));var rp=require(_0xf427('0x4'));var moment=require(_0xf427('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf427('0x6'));var util=require(_0xf427('0x7'));var path=require('path');var sox=require(_0xf427('0x8'));var csv=require(_0xf427('0x9'));var ejs=require(_0xf427('0xa'));var fs=require('fs');var _=require(_0xf427('0xb'));var squel=require(_0xf427('0xc'));var crypto=require(_0xf427('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf427('0xe'));var toCsv=require(_0xf427('0x9'));var querystring=require(_0xf427('0xf'));var Papa=require(_0xf427('0x10'));var Redis=require('ioredis');var authService=require(_0xf427('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf427('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf427('0x13'))(_0xf427('0x14'));var utils=require(_0xf427('0x15'));var config=require(_0xf427('0x16'));var licenseUtil=require(_0xf427('0x17'));var db=require(_0xf427('0x18'))['db'];function respondWithStatusCode(_0x3ec6b2,_0xdb0c3f){_0xdb0c3f=_0xdb0c3f||0xcc;return function(_0x1e469e){if(_0x1e469e){return _0x3ec6b2[_0xf427('0x19')](_0xdb0c3f);}return _0x3ec6b2[_0xf427('0x1a')](_0xdb0c3f)[_0xf427('0x1b')]();};}function respondWithResult(_0x2cbca5,_0x2e3dc0){_0x2e3dc0=_0x2e3dc0||0xc8;return function(_0x3abac8){if(_0x3abac8){return _0x2cbca5['status'](_0x2e3dc0)[_0xf427('0x1c')](_0x3abac8);}};}function respondWithFilteredResult(_0x156e8e,_0x3ecd3f){return function(_0x9bd401){if(_0x9bd401){var _0x1cb487=_0x9bd401[_0xf427('0x1d')],_0x242e4a=_0x3ecd3f[_0xf427('0x1e')],_0x1681c6=_0x3ecd3f[_0xf427('0x1e')]+_0x3ecd3f[_0xf427('0x1f')],_0x4b76ec;if(_0x1681c6>=_0x1cb487){_0x1681c6=_0x1cb487;_0x4b76ec=0xc8;}else{_0x4b76ec=0xce;}_0x156e8e[_0xf427('0x1a')](_0x4b76ec);return _0x156e8e['set']('Content-Range',_0x242e4a+'-'+_0x1681c6+'/'+_0x1cb487)['json'](_0x9bd401);}return null;};}function patchUpdates(_0x33d35a){return function(_0x1d0da0){try{jsonpatch[_0xf427('0x20')](_0x1d0da0,_0x33d35a,!![]);}catch(_0x3f6baa){return BPromise[_0xf427('0x21')](_0x3f6baa);}return _0x1d0da0['save']();};}function saveUpdates(_0x105954,_0x52b75d){return function(_0x32ca54){if(_0x32ca54){return _0x32ca54['update'](_0x105954)['then'](function(_0x3e642f){return _0x3e642f;});}return null;};}function removeEntity(_0x5824ab,_0x150744){return function(_0x560b6c){if(_0x560b6c){return _0x560b6c[_0xf427('0x22')]()[_0xf427('0x23')](function(){var _0x40573b=_0x560b6c[_0xf427('0x24')]({'plain':!![]});var _0x50bc67=_0xf427('0x25');return db[_0xf427('0x26')][_0xf427('0x22')]({'where':{'type':_0x50bc67,'resourceId':_0x40573b['id']}})['then'](function(){return _0x560b6c;});})[_0xf427('0x23')](function(){_0x5824ab[_0xf427('0x1a')](0xcc)[_0xf427('0x1b')]();});}};}function handleEntityNotFound(_0x39caac,_0xe446b3){return function(_0x534588){if(!_0x534588){_0x39caac[_0xf427('0x19')](0x194);}return _0x534588;};}function handleError(_0x405b09,_0xc21e24){_0xc21e24=_0xc21e24||0x1f4;return function(_0x5f0ca4){logger['error'](_0x5f0ca4[_0xf427('0x27')]);if(_0x5f0ca4[_0xf427('0x28')]){delete _0x5f0ca4[_0xf427('0x28')];}_0x405b09['status'](_0xc21e24)[_0xf427('0x29')](_0x5f0ca4);};}exports[_0xf427('0x2a')]=function(_0x91ecb6,_0x4a55e8){var _0x41f351={},_0x104966={},_0x4049ed={'count':0x0,'rows':[]};var _0x5948f9=_[_0xf427('0x2b')](db['Schedule'][_0xf427('0x2c')],function(_0x5d2c5f){return{'name':_0x5d2c5f['fieldName'],'type':_0x5d2c5f['type'][_0xf427('0x2d')]};});_0x104966[_0xf427('0x2e')]=_[_0xf427('0x2b')](_0x5948f9,'name');_0x104966[_0xf427('0x2f')]=_[_0xf427('0x30')](_0x91ecb6[_0xf427('0x2f')]);_0x104966[_0xf427('0x31')]=_['intersection'](_0x104966[_0xf427('0x2e')],_0x104966[_0xf427('0x2f')]);_0x41f351[_0xf427('0x32')]=_[_0xf427('0x33')](_0x104966[_0xf427('0x2e')],qs[_0xf427('0x34')](_0x91ecb6[_0xf427('0x2f')][_0xf427('0x34')]));_0x41f351[_0xf427('0x32')]=_0x41f351[_0xf427('0x32')][_0xf427('0x35')]?_0x41f351[_0xf427('0x32')]:_0x104966[_0xf427('0x2e')];if(!_0x91ecb6[_0xf427('0x2f')]['hasOwnProperty']('nolimit')){_0x41f351['limit']=qs[_0xf427('0x1f')](_0x91ecb6[_0xf427('0x2f')][_0xf427('0x1f')]);_0x41f351['offset']=qs[_0xf427('0x1e')](_0x91ecb6[_0xf427('0x2f')]['offset']);}_0x41f351[_0xf427('0x36')]=qs['sort'](_0x91ecb6[_0xf427('0x2f')]['sort']);_0x41f351[_0xf427('0x37')]=qs[_0xf427('0x31')](_[_0xf427('0x38')](_0x91ecb6[_0xf427('0x2f')],_0x104966[_0xf427('0x31')]),_0x5948f9);if(_0x91ecb6[_0xf427('0x2f')][_0xf427('0x39')]){_0x41f351[_0xf427('0x37')]=_['merge'](_0x41f351[_0xf427('0x37')],{'$or':_[_0xf427('0x2b')](_0x5948f9,function(_0x49908b){if(_0x49908b[_0xf427('0x3a')]!==_0xf427('0x3b')){var _0x161691={};_0x161691[_0x49908b[_0xf427('0x28')]]={'$like':'%'+_0x91ecb6[_0xf427('0x2f')][_0xf427('0x39')]+'%'};return _0x161691;}})});}_0x41f351=_[_0xf427('0x3c')]({},_0x41f351,_0x91ecb6[_0xf427('0x3d')]);var _0x38a4e1={'where':_0x41f351[_0xf427('0x37')]};return db[_0xf427('0x3e')][_0xf427('0x1d')](_0x38a4e1)[_0xf427('0x23')](function(_0x19b322){_0x4049ed['count']=_0x19b322;if(_0x91ecb6[_0xf427('0x2f')][_0xf427('0x3f')]){_0x41f351[_0xf427('0x40')]=[{'all':!![]}];}return db[_0xf427('0x3e')][_0xf427('0x41')](_0x41f351);})[_0xf427('0x23')](function(_0x36276e){_0x4049ed[_0xf427('0x42')]=_0x36276e;return _0x4049ed;})[_0xf427('0x23')](respondWithFilteredResult(_0x4a55e8,_0x41f351))[_0xf427('0x43')](handleError(_0x4a55e8,null));};exports[_0xf427('0x44')]=function(_0xea52cb,_0x60cda1){var _0x59d391={'raw':![],'where':{'id':_0xea52cb[_0xf427('0x45')]['id']}},_0x5e68c0={};_0x5e68c0[_0xf427('0x2e')]=_['keys'](db[_0xf427('0x3e')][_0xf427('0x2c')]);_0x5e68c0[_0xf427('0x2f')]=_[_0xf427('0x30')](_0xea52cb[_0xf427('0x2f')]);_0x5e68c0[_0xf427('0x31')]=_[_0xf427('0x33')](_0x5e68c0[_0xf427('0x2e')],_0x5e68c0[_0xf427('0x2f')]);_0x59d391[_0xf427('0x32')]=_['intersection'](_0x5e68c0['model'],qs[_0xf427('0x34')](_0xea52cb[_0xf427('0x2f')][_0xf427('0x34')]));_0x59d391['attributes']=_0x59d391['attributes'][_0xf427('0x35')]?_0x59d391['attributes']:_0x5e68c0[_0xf427('0x2e')];if(_0xea52cb[_0xf427('0x2f')][_0xf427('0x3f')]){_0x59d391['include']=[{'all':!![]}];}_0x59d391=_['merge']({},_0x59d391,_0xea52cb['options']);return db['Schedule'][_0xf427('0x46')](_0x59d391)[_0xf427('0x23')](handleEntityNotFound(_0x60cda1,null))[_0xf427('0x23')](respondWithResult(_0x60cda1,null))['catch'](handleError(_0x60cda1,null));};exports[_0xf427('0x47')]=function(_0x71a300,_0x381d38){return db[_0xf427('0x3e')][_0xf427('0x47')](_0x71a300[_0xf427('0x48')],{})['then'](function(_0x5c5d7f){var _0xe49f76=_0x71a300['user'][_0xf427('0x24')]({'plain':!![]});if(!_0xe49f76)throw new Error(_0xf427('0x49'));if(_0xe49f76[_0xf427('0x4a')]===_0xf427('0x4b')){var _0x427854=_0x5c5d7f['get']({'plain':!![]});var _0x55ca35=_0xf427('0x25');return db['UserProfileSection']['find']({'where':{'name':_0x55ca35,'userProfileId':_0xe49f76['userProfileId']},'raw':!![]})['then'](function(_0x9736cf){if(_0x9736cf&&_0x9736cf['autoAssociation']===0x0){return db[_0xf427('0x26')][_0xf427('0x47')]({'name':_0x427854[_0xf427('0x28')],'resourceId':_0x427854['id'],'type':_0x9736cf[_0xf427('0x28')],'sectionId':_0x9736cf['id']},{})['then'](function(){return _0x5c5d7f;});}else{return _0x5c5d7f;}})[_0xf427('0x43')](function(_0x2f667c){logger[_0xf427('0x4c')](_0xf427('0x4d'),_0x2f667c);throw _0x2f667c;});}return _0x5c5d7f;})['then'](respondWithResult(_0x381d38,0xc9))['catch'](handleError(_0x381d38,null));};exports[_0xf427('0x4e')]=function(_0x4ea3c8,_0x48d8bc){if(_0x4ea3c8[_0xf427('0x48')]['id']){delete _0x4ea3c8[_0xf427('0x48')]['id'];}return db[_0xf427('0x3e')][_0xf427('0x46')]({'where':{'id':_0x4ea3c8[_0xf427('0x45')]['id']}})[_0xf427('0x23')](handleEntityNotFound(_0x48d8bc,null))[_0xf427('0x23')](saveUpdates(_0x4ea3c8[_0xf427('0x48')],null))[_0xf427('0x23')](respondWithResult(_0x48d8bc,null))[_0xf427('0x43')](handleError(_0x48d8bc,null));};exports[_0xf427('0x22')]=function(_0x3b7b85,_0x10d381){return db['Schedule'][_0xf427('0x46')]({'where':{'id':_0x3b7b85[_0xf427('0x45')]['id']}})[_0xf427('0x23')](handleEntityNotFound(_0x10d381,null))[_0xf427('0x23')](removeEntity(_0x10d381,null))[_0xf427('0x43')](handleError(_0x10d381,null));};exports['run']=function(_0x3486dc,_0x3ae6cd,_0x4bb4ce){var _0x2b6cf3=require(_0xf427('0x4f'));return db[_0xf427('0x3e')]['find']({'where':{'id':_0x3486dc[_0xf427('0x45')]['id']},'raw':!![]})[_0xf427('0x23')](handleEntityNotFound(_0x3ae6cd,null))[_0xf427('0x23')](function(){_0x2b6cf3[_0xf427('0x50')](_0x3486dc['params']['id']);})['then'](respondWithStatusCode(_0x3ae6cd,null))['catch'](handleError(_0x3ae6cd,null));};
\ No newline at end of file
+var _0x76dc=['length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','count','includeAll','findAll','rows','catch','params','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','../../config/schedule','run','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','limit','Content-Range','reject','save','update','then','destroy','get','Scheduler','UserProfileResource','sendStatus','stack','name','send','Schedule','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields'];(function(_0x15ec4e,_0x40b7e0){var _0xb5e5dd=function(_0x42bdd7){while(--_0x42bdd7){_0x15ec4e['push'](_0x15ec4e['shift']());}};_0xb5e5dd(++_0x40b7e0);}(_0x76dc,0x1a0));var _0xc76d=function(_0x320da1,_0x31e289){_0x320da1=_0x320da1-0x0;var _0x1a9db5=_0x76dc[_0x320da1];return _0x1a9db5;};'use strict';var emlformat=require(_0xc76d('0x0'));var rimraf=require(_0xc76d('0x1'));var zipdir=require(_0xc76d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc76d('0x3'));var moment=require('moment');var BPromise=require(_0xc76d('0x4'));var Mustache=require('mustache');var util=require(_0xc76d('0x5'));var path=require(_0xc76d('0x6'));var sox=require(_0xc76d('0x7'));var csv=require(_0xc76d('0x8'));var ejs=require(_0xc76d('0x9'));var fs=require('fs');var fs_extra=require(_0xc76d('0xa'));var _=require('lodash');var squel=require(_0xc76d('0xb'));var crypto=require('crypto');var jsforce=require(_0xc76d('0xc'));var deskjs=require(_0xc76d('0xd'));var toCsv=require(_0xc76d('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc76d('0xe'));var authService=require(_0xc76d('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xc76d('0x10'));var hardwareService=require(_0xc76d('0x11'));var logger=require(_0xc76d('0x12'))(_0xc76d('0x13'));var utils=require(_0xc76d('0x14'));var config=require(_0xc76d('0x15'));var licenseUtil=require(_0xc76d('0x16'));var db=require(_0xc76d('0x17'))['db'];function respondWithStatusCode(_0x3c03af,_0x95c397){_0x95c397=_0x95c397||0xcc;return function(_0x589ea2){if(_0x589ea2){return _0x3c03af['sendStatus'](_0x95c397);}return _0x3c03af[_0xc76d('0x18')](_0x95c397)['end']();};}function respondWithResult(_0x12321f,_0x5ee526){_0x5ee526=_0x5ee526||0xc8;return function(_0x385da3){if(_0x385da3){return _0x12321f[_0xc76d('0x18')](_0x5ee526)['json'](_0x385da3);}};}function respondWithFilteredResult(_0x5b6212,_0x2abd0a){return function(_0x2f1479){if(_0x2f1479){var _0x1b1bd4=_0x2f1479['count'],_0x1d054a=_0x2abd0a[_0xc76d('0x19')],_0x2248cf=_0x2abd0a[_0xc76d('0x19')]+_0x2abd0a[_0xc76d('0x1a')],_0x412404;if(_0x2248cf>=_0x1b1bd4){_0x2248cf=_0x1b1bd4;_0x412404=0xc8;}else{_0x412404=0xce;}_0x5b6212[_0xc76d('0x18')](_0x412404);return _0x5b6212['set'](_0xc76d('0x1b'),_0x1d054a+'-'+_0x2248cf+'/'+_0x1b1bd4)['json'](_0x2f1479);}return null;};}function patchUpdates(_0x4350b2){return function(_0x326415){try{jsonpatch['apply'](_0x326415,_0x4350b2,!![]);}catch(_0x17a231){return BPromise[_0xc76d('0x1c')](_0x17a231);}return _0x326415[_0xc76d('0x1d')]();};}function saveUpdates(_0x3ab49b,_0x4c502a){return function(_0x5ec342){if(_0x5ec342){return _0x5ec342[_0xc76d('0x1e')](_0x3ab49b)[_0xc76d('0x1f')](function(_0x49eda5){return _0x49eda5;});}return null;};}function removeEntity(_0x2f8195,_0x5dc1d9){return function(_0x148cfd){if(_0x148cfd){return _0x148cfd[_0xc76d('0x20')]()['then'](function(){var _0x56755a=_0x148cfd[_0xc76d('0x21')]({'plain':!![]});var _0x39e16c=_0xc76d('0x22');return db[_0xc76d('0x23')][_0xc76d('0x20')]({'where':{'type':_0x39e16c,'resourceId':_0x56755a['id']}})[_0xc76d('0x1f')](function(){return _0x148cfd;});})[_0xc76d('0x1f')](function(){_0x2f8195[_0xc76d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47e2cb,_0x2fc71d){return function(_0x291adf){if(!_0x291adf){_0x47e2cb[_0xc76d('0x24')](0x194);}return _0x291adf;};}function handleError(_0x352c47,_0x3fe1cc){_0x3fe1cc=_0x3fe1cc||0x1f4;return function(_0x2b850f){logger['error'](_0x2b850f[_0xc76d('0x25')]);if(_0x2b850f['name']){delete _0x2b850f[_0xc76d('0x26')];}_0x352c47['status'](_0x3fe1cc)[_0xc76d('0x27')](_0x2b850f);};}exports['index']=function(_0x9c22d1,_0x3974d2){var _0x5c6c81={},_0x210e21={},_0x16fd25={'count':0x0,'rows':[]};var _0x51aa24=_['map'](db[_0xc76d('0x28')][_0xc76d('0x29')],function(_0x15ea80){return{'name':_0x15ea80[_0xc76d('0x2a')],'type':_0x15ea80[_0xc76d('0x2b')]['key']};});_0x210e21[_0xc76d('0x2c')]=_[_0xc76d('0x2d')](_0x51aa24,_0xc76d('0x26'));_0x210e21[_0xc76d('0x2e')]=_[_0xc76d('0x2f')](_0x9c22d1[_0xc76d('0x2e')]);_0x210e21[_0xc76d('0x30')]=_[_0xc76d('0x31')](_0x210e21[_0xc76d('0x2c')],_0x210e21[_0xc76d('0x2e')]);_0x5c6c81[_0xc76d('0x32')]=_['intersection'](_0x210e21[_0xc76d('0x2c')],qs[_0xc76d('0x33')](_0x9c22d1[_0xc76d('0x2e')][_0xc76d('0x33')]));_0x5c6c81[_0xc76d('0x32')]=_0x5c6c81['attributes'][_0xc76d('0x34')]?_0x5c6c81['attributes']:_0x210e21['model'];if(!_0x9c22d1['query'][_0xc76d('0x35')](_0xc76d('0x36'))){_0x5c6c81[_0xc76d('0x1a')]=qs[_0xc76d('0x1a')](_0x9c22d1['query'][_0xc76d('0x1a')]);_0x5c6c81['offset']=qs[_0xc76d('0x19')](_0x9c22d1[_0xc76d('0x2e')][_0xc76d('0x19')]);}_0x5c6c81[_0xc76d('0x37')]=qs[_0xc76d('0x38')](_0x9c22d1[_0xc76d('0x2e')][_0xc76d('0x38')]);_0x5c6c81[_0xc76d('0x39')]=qs['filters'](_['pick'](_0x9c22d1[_0xc76d('0x2e')],_0x210e21[_0xc76d('0x30')]),_0x51aa24);if(_0x9c22d1['query'][_0xc76d('0x3a')]){_0x5c6c81[_0xc76d('0x39')]=_[_0xc76d('0x3b')](_0x5c6c81['where'],{'$or':_[_0xc76d('0x2d')](_0x51aa24,function(_0x882f17){if(_0x882f17[_0xc76d('0x2b')]!==_0xc76d('0x3c')){var _0x3d6638={};_0x3d6638[_0x882f17['name']]={'$like':'%'+_0x9c22d1[_0xc76d('0x2e')][_0xc76d('0x3a')]+'%'};return _0x3d6638;}})});}_0x5c6c81=_[_0xc76d('0x3b')]({},_0x5c6c81,_0x9c22d1[_0xc76d('0x3d')]);var _0x59ef3c={'where':_0x5c6c81['where']};return db[_0xc76d('0x28')][_0xc76d('0x3e')](_0x59ef3c)[_0xc76d('0x1f')](function(_0x28aa3c){_0x16fd25[_0xc76d('0x3e')]=_0x28aa3c;if(_0x9c22d1[_0xc76d('0x2e')][_0xc76d('0x3f')]){_0x5c6c81['include']=[{'all':!![]}];}return db[_0xc76d('0x28')][_0xc76d('0x40')](_0x5c6c81);})[_0xc76d('0x1f')](function(_0x44b1dc){_0x16fd25[_0xc76d('0x41')]=_0x44b1dc;return _0x16fd25;})[_0xc76d('0x1f')](respondWithFilteredResult(_0x3974d2,_0x5c6c81))[_0xc76d('0x42')](handleError(_0x3974d2,null));};exports['show']=function(_0x2d5abe,_0x1c1d7c){var _0x1ef9e9={'raw':![],'where':{'id':_0x2d5abe[_0xc76d('0x43')]['id']}},_0x43708f={};_0x43708f[_0xc76d('0x2c')]=_[_0xc76d('0x2f')](db[_0xc76d('0x28')][_0xc76d('0x29')]);_0x43708f[_0xc76d('0x2e')]=_[_0xc76d('0x2f')](_0x2d5abe[_0xc76d('0x2e')]);_0x43708f['filters']=_[_0xc76d('0x31')](_0x43708f['model'],_0x43708f[_0xc76d('0x2e')]);_0x1ef9e9[_0xc76d('0x32')]=_[_0xc76d('0x31')](_0x43708f['model'],qs[_0xc76d('0x33')](_0x2d5abe[_0xc76d('0x2e')]['fields']));_0x1ef9e9[_0xc76d('0x32')]=_0x1ef9e9[_0xc76d('0x32')][_0xc76d('0x34')]?_0x1ef9e9[_0xc76d('0x32')]:_0x43708f['model'];if(_0x2d5abe[_0xc76d('0x2e')][_0xc76d('0x3f')]){_0x1ef9e9[_0xc76d('0x44')]=[{'all':!![]}];}_0x1ef9e9=_[_0xc76d('0x3b')]({},_0x1ef9e9,_0x2d5abe[_0xc76d('0x3d')]);return db[_0xc76d('0x28')]['find'](_0x1ef9e9)[_0xc76d('0x1f')](handleEntityNotFound(_0x1c1d7c,null))['then'](respondWithResult(_0x1c1d7c,null))[_0xc76d('0x42')](handleError(_0x1c1d7c,null));};exports[_0xc76d('0x45')]=function(_0x111a79,_0x4f7a53){return db[_0xc76d('0x28')]['create'](_0x111a79[_0xc76d('0x46')],{})[_0xc76d('0x1f')](function(_0x3923cc){var _0x2062d0=_0x111a79[_0xc76d('0x47')][_0xc76d('0x21')]({'plain':!![]});if(!_0x2062d0)throw new Error(_0xc76d('0x48'));if(_0x2062d0['role']===_0xc76d('0x47')){var _0x2b54d3=_0x3923cc[_0xc76d('0x21')]({'plain':!![]});var _0x3c00ad='Scheduler';return db['UserProfileSection']['find']({'where':{'name':_0x3c00ad,'userProfileId':_0x2062d0['userProfileId']},'raw':!![]})[_0xc76d('0x1f')](function(_0x4e8d17){if(_0x4e8d17&&_0x4e8d17['autoAssociation']===0x0){return db[_0xc76d('0x23')][_0xc76d('0x45')]({'name':_0x2b54d3[_0xc76d('0x26')],'resourceId':_0x2b54d3['id'],'type':_0x4e8d17[_0xc76d('0x26')],'sectionId':_0x4e8d17['id']},{})['then'](function(){return _0x3923cc;});}else{return _0x3923cc;}})[_0xc76d('0x42')](function(_0x2e1998){logger[_0xc76d('0x49')](_0xc76d('0x4a'),_0x2e1998);throw _0x2e1998;});}return _0x3923cc;})[_0xc76d('0x1f')](respondWithResult(_0x4f7a53,0xc9))[_0xc76d('0x42')](handleError(_0x4f7a53,null));};exports['update']=function(_0x32dfa4,_0x95e81a){if(_0x32dfa4[_0xc76d('0x46')]['id']){delete _0x32dfa4[_0xc76d('0x46')]['id'];}return db[_0xc76d('0x28')][_0xc76d('0x4b')]({'where':{'id':_0x32dfa4[_0xc76d('0x43')]['id']}})['then'](handleEntityNotFound(_0x95e81a,null))['then'](saveUpdates(_0x32dfa4[_0xc76d('0x46')],null))[_0xc76d('0x1f')](respondWithResult(_0x95e81a,null))[_0xc76d('0x42')](handleError(_0x95e81a,null));};exports[_0xc76d('0x20')]=function(_0x5ac8b3,_0x4ab4fa){return db[_0xc76d('0x28')]['find']({'where':{'id':_0x5ac8b3[_0xc76d('0x43')]['id']}})[_0xc76d('0x1f')](handleEntityNotFound(_0x4ab4fa,null))[_0xc76d('0x1f')](removeEntity(_0x4ab4fa,null))[_0xc76d('0x42')](handleError(_0x4ab4fa,null));};exports['run']=function(_0x4585d0,_0x5b72a2,_0x56164b){var _0x464d9d=require(_0xc76d('0x4c'));return db[_0xc76d('0x28')][_0xc76d('0x4b')]({'where':{'id':_0x4585d0[_0xc76d('0x43')]['id']},'raw':!![]})[_0xc76d('0x1f')](handleEntityNotFound(_0x5b72a2,null))[_0xc76d('0x1f')](function(){_0x464d9d[_0xc76d('0x4d')](_0x4585d0[_0xc76d('0x43')]['id']);})[_0xc76d('0x1f')](respondWithStatusCode(_0x5b72a2,null))['catch'](handleError(_0x5b72a2,null));};
\ No newline at end of file