Built motion from commit b5996064.|2.6.21
[motion2.git] / server / api / cmCustomField / cmCustomField.controller.js
index 9a34724..78debb8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x67d5=['CmCustomField','rawAttributes','type','model','differenceBy','map','query','keys','intersection','attributes','fields','nolimit','limit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','length','find','update','body','params','create','sequelize','Sequelize','TEXT','text','number','INTEGER','switch','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','save','then','destroy','end','error','stack','name','index'];(function(_0x36e1a2,_0x67de6c){var _0x2aa224=function(_0x9db573){while(--_0x9db573){_0x36e1a2['push'](_0x36e1a2['shift']());}};_0x2aa224(++_0x67de6c);}(_0x67d5,0x16c));var _0x567d=function(_0x376ce7,_0x39c7d7){_0x376ce7=_0x376ce7-0x0;var _0x497c1e=_0x67d5[_0x376ce7];return _0x497c1e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x567d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x567d('0x1'));var moment=require(_0x567d('0x2'));var BPromise=require(_0x567d('0x3'));var Mustache=require(_0x567d('0x4'));var util=require('util');var path=require(_0x567d('0x5'));var sox=require(_0x567d('0x6'));var csv=require(_0x567d('0x7'));var ejs=require(_0x567d('0x8'));var fs=require('fs');var fs_extra=require(_0x567d('0x9'));var _=require(_0x567d('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x567d('0xb'));var deskjs=require(_0x567d('0xc'));var toCsv=require(_0x567d('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x567d('0xd'));var authService=require(_0x567d('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x567d('0xf'));var hardwareService=require(_0x567d('0x10'));var logger=require(_0x567d('0x11'))(_0x567d('0x12'));var utils=require(_0x567d('0x13'));var config=require(_0x567d('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x567d('0x15'))['db'];function respondWithStatusCode(_0x2bb48a,_0x3921c9){_0x3921c9=_0x3921c9||0xcc;return function(_0x5e1093){if(_0x5e1093){return _0x2bb48a[_0x567d('0x16')](_0x3921c9);}return _0x2bb48a[_0x567d('0x17')](_0x3921c9)['end']();};}function respondWithResult(_0x575aa7,_0x3071a1){_0x3071a1=_0x3071a1||0xc8;return function(_0x3acb79){if(_0x3acb79){return _0x575aa7[_0x567d('0x17')](_0x3071a1)[_0x567d('0x18')](_0x3acb79);}};}function respondWithFilteredResult(_0x135315,_0x148bc9){return function(_0x3129b7){if(_0x3129b7){var _0xbb932=typeof _0x148bc9[_0x567d('0x19')]==='undefined'&&typeof _0x148bc9['limit']===_0x567d('0x1a');var _0x587aba=_0x3129b7[_0x567d('0x1b')];var _0x52b075=_0xbb932?0x0:_0x148bc9['offset'];var _0x5a7b1d=_0xbb932?_0x3129b7[_0x567d('0x1b')]:_0x148bc9[_0x567d('0x19')]+_0x148bc9['limit'];var _0x1e29d2;if(_0x5a7b1d>=_0x587aba){_0x5a7b1d=_0x587aba;_0x1e29d2=0xc8;}else{_0x1e29d2=0xce;}_0x135315[_0x567d('0x17')](_0x1e29d2);return _0x135315['set']('Content-Range',_0x52b075+'-'+_0x5a7b1d+'/'+_0x587aba)[_0x567d('0x18')](_0x3129b7);}return null;};}function patchUpdates(_0x296d8b){return function(_0x2d96fb){try{jsonpatch['apply'](_0x2d96fb,_0x296d8b,!![]);}catch(_0x3e6554){return BPromise['reject'](_0x3e6554);}return _0x2d96fb[_0x567d('0x1c')]();};}function saveUpdates(_0xdea105,_0x28b2a5){return function(_0x50247d){if(_0x50247d){return _0x50247d['update'](_0xdea105)[_0x567d('0x1d')](function(_0x2c9eed){return _0x2c9eed;});}return null;};}function removeEntity(_0x3a040a,_0x2752d9){return function(_0x4eb516){if(_0x4eb516){return _0x4eb516[_0x567d('0x1e')]()[_0x567d('0x1d')](function(){_0x3a040a[_0x567d('0x17')](0xcc)[_0x567d('0x1f')]();});}};}function handleEntityNotFound(_0x3caf85,_0x4bd5d9){return function(_0x22bfe8){if(!_0x22bfe8){_0x3caf85['sendStatus'](0x194);}return _0x22bfe8;};}function handleError(_0x4d39ce,_0x3ff2b0){_0x3ff2b0=_0x3ff2b0||0x1f4;return function(_0x178a04){logger[_0x567d('0x20')](_0x178a04[_0x567d('0x21')]);if(_0x178a04[_0x567d('0x22')]){delete _0x178a04[_0x567d('0x22')];}_0x4d39ce[_0x567d('0x17')](_0x3ff2b0)['send'](_0x178a04);};}exports[_0x567d('0x23')]=function(_0xe9d55,_0x856dc){var _0xafb313={},_0x27191d={},_0x2f6ea9={'count':0x0,'rows':[]};var _0x241c87=_['map'](db[_0x567d('0x24')][_0x567d('0x25')],function(_0x3e6660){return{'name':_0x3e6660['fieldName'],'type':_0x3e6660[_0x567d('0x26')]['key']};});_0x27191d[_0x567d('0x27')]=_[_0x567d('0x28')](_[_0x567d('0x29')](_0x241c87,_0x567d('0x22')),[_0x567d('0x22')]);_0x27191d[_0x567d('0x2a')]=_[_0x567d('0x2b')](_0xe9d55[_0x567d('0x2a')]);_0x27191d['filters']=_[_0x567d('0x2c')](_0x27191d[_0x567d('0x27')],_0x27191d[_0x567d('0x2a')]);_0xafb313[_0x567d('0x2d')]=_[_0x567d('0x2c')](_0x27191d['model'],qs[_0x567d('0x2e')](_0xe9d55['query'][_0x567d('0x2e')]));_0xafb313[_0x567d('0x2d')]=_0xafb313[_0x567d('0x2d')]['length']?_0xafb313[_0x567d('0x2d')]:_0x27191d[_0x567d('0x27')];if(!_0xe9d55[_0x567d('0x2a')]['hasOwnProperty'](_0x567d('0x2f'))){_0xafb313[_0x567d('0x30')]=qs[_0x567d('0x30')](_0xe9d55[_0x567d('0x2a')][_0x567d('0x30')]);_0xafb313[_0x567d('0x19')]=qs[_0x567d('0x19')](_0xe9d55[_0x567d('0x2a')][_0x567d('0x19')]);}_0xafb313[_0x567d('0x31')]=qs[_0x567d('0x32')](_0xe9d55['query'][_0x567d('0x32')]);_0xafb313[_0x567d('0x33')]=qs[_0x567d('0x34')](_['pick'](_0xe9d55[_0x567d('0x2a')],_0x27191d[_0x567d('0x34')]),_0x241c87);if(_0xe9d55[_0x567d('0x2a')][_0x567d('0x35')]){_0xafb313[_0x567d('0x33')]=_[_0x567d('0x36')](_0xafb313[_0x567d('0x33')],{'$or':_[_0x567d('0x29')](_0x241c87,function(_0xd15e76){if(_0xd15e76[_0x567d('0x26')]!==_0x567d('0x37')){var _0xc90c2b={};_0xc90c2b[_0xd15e76[_0x567d('0x22')]]={'$like':'%'+_0xe9d55[_0x567d('0x2a')]['filter']+'%'};return _0xc90c2b;}})});}_0xafb313=_[_0x567d('0x36')]({},_0xafb313,_0xe9d55[_0x567d('0x38')]);var _0x1f53e8={'where':_0xafb313[_0x567d('0x33')]};return db['CmCustomField']['count'](_0x1f53e8)[_0x567d('0x1d')](function(_0x64bfa3){_0x2f6ea9[_0x567d('0x1b')]=_0x64bfa3;if(_0xe9d55['query'][_0x567d('0x39')]){_0xafb313[_0x567d('0x3a')]=[{'all':!![]}];}return db[_0x567d('0x24')][_0x567d('0x3b')](_0xafb313);})[_0x567d('0x1d')](function(_0x3d191d){_0x2f6ea9['rows']=_0x3d191d;return _0x2f6ea9;})[_0x567d('0x1d')](respondWithFilteredResult(_0x856dc,_0xafb313))[_0x567d('0x3c')](handleError(_0x856dc,null));};exports['show']=function(_0x315d6a,_0x5c0ac2){var _0x126039={'raw':!![],'where':{'id':_0x315d6a['params']['id']}},_0x41ce35={};_0x41ce35[_0x567d('0x27')]=_[_0x567d('0x2b')](db[_0x567d('0x24')][_0x567d('0x25')]);_0x41ce35[_0x567d('0x2a')]=_[_0x567d('0x2b')](_0x315d6a['query']);_0x41ce35[_0x567d('0x34')]=_[_0x567d('0x2c')](_0x41ce35[_0x567d('0x27')],_0x41ce35[_0x567d('0x2a')]);_0x126039[_0x567d('0x2d')]=_[_0x567d('0x2c')](_0x41ce35[_0x567d('0x27')],qs[_0x567d('0x2e')](_0x315d6a['query'][_0x567d('0x2e')]));_0x126039[_0x567d('0x2d')]=_0x126039[_0x567d('0x2d')][_0x567d('0x3d')]?_0x126039[_0x567d('0x2d')]:_0x41ce35[_0x567d('0x27')];if(_0x315d6a[_0x567d('0x2a')][_0x567d('0x39')]){_0x126039[_0x567d('0x3a')]=[{'all':!![]}];}_0x126039=_['merge']({},_0x126039,_0x315d6a[_0x567d('0x38')]);return db[_0x567d('0x24')][_0x567d('0x3e')](_0x126039)[_0x567d('0x1d')](handleEntityNotFound(_0x5c0ac2,null))['then'](respondWithResult(_0x5c0ac2,null))['catch'](handleError(_0x5c0ac2,null));};exports[_0x567d('0x3f')]=function(_0x27821d,_0x1a16d1){if(_0x27821d[_0x567d('0x40')]['id']){delete _0x27821d['body']['id'];}return db[_0x567d('0x24')][_0x567d('0x3e')]({'where':{'id':_0x27821d[_0x567d('0x41')]['id']}})[_0x567d('0x1d')](handleEntityNotFound(_0x1a16d1,null))['then'](saveUpdates(_0x27821d['body'],null))[_0x567d('0x1d')](respondWithResult(_0x1a16d1,null))[_0x567d('0x3c')](handleError(_0x1a16d1,null));};exports[_0x567d('0x1e')]=function(_0x6a4f18,_0x3671f6){return db[_0x567d('0x24')][_0x567d('0x3e')]({'where':{'id':_0x6a4f18[_0x567d('0x41')]['id']}})[_0x567d('0x1d')](handleEntityNotFound(_0x3671f6,null))[_0x567d('0x1d')](removeEntity(_0x3671f6,null))['catch'](handleError(_0x3671f6,null));};exports[_0x567d('0x42')]=function(_0x2ccec5,_0x2c8893){var _0x453eb9;return db[_0x567d('0x43')]['transaction'](function(_0x55fbc7){return db[_0x567d('0x24')]['create'](_0x2ccec5[_0x567d('0x40')],{'transaction':_0x55fbc7})[_0x567d('0x1d')](function(_0x4317cf){_0x453eb9=_0x4317cf;var _0x1c40e6={'type':db[_0x567d('0x44')][_0x567d('0x45')],'transaction':_0x55fbc7};switch(_0x2ccec5[_0x567d('0x40')][_0x567d('0x26')]){case _0x567d('0x46'):_0x1c40e6[_0x567d('0x26')]=db[_0x567d('0x44')][_0x567d('0x45')];break;case _0x567d('0x47'):_0x1c40e6[_0x567d('0x26')]=db[_0x567d('0x44')][_0x567d('0x48')];break;case _0x567d('0x49'):_0x1c40e6[_0x567d('0x26')]=db[_0x567d('0x44')]['BOOLEAN'];_0x1c40e6[_0x567d('0x4a')]=![];break;default:}return db['sequelize'][_0x567d('0x4b')][_0x567d('0x4c')](_0x567d('0x4d'),util[_0x567d('0x4e')](_0x567d('0x4f'),_0x453eb9['id']),_0x1c40e6);})[_0x567d('0x1d')](function(){return _0x453eb9;});})[_0x567d('0x1d')](respondWithResult(_0x2c8893,0xc9))['catch'](handleError(_0x2c8893,null));};
\ No newline at end of file
+var _0xd487=['desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','reject','save','update','then','destroy','error','stack','name','send','CmCustomField','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','body','create','sequelize','transaction','Sequelize','TEXT','text','INTEGER','BOOLEAN','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','jsforce'];(function(_0x27a5bb,_0x3f4cfb){var _0x2e17ea=function(_0x22912d){while(--_0x22912d){_0x27a5bb['push'](_0x27a5bb['shift']());}};_0x2e17ea(++_0x3f4cfb);}(_0xd487,0xec));var _0x7d48=function(_0x7b5cdd,_0x8c88d8){_0x7b5cdd=_0x7b5cdd-0x0;var _0x3a29ae=_0xd487[_0x7b5cdd];return _0x3a29ae;};'use strict';var emlformat=require(_0x7d48('0x0'));var rimraf=require(_0x7d48('0x1'));var zipdir=require(_0x7d48('0x2'));var jsonpatch=require(_0x7d48('0x3'));var rp=require('request-promise');var moment=require(_0x7d48('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7d48('0x5'));var util=require(_0x7d48('0x6'));var path=require(_0x7d48('0x7'));var sox=require(_0x7d48('0x8'));var csv=require(_0x7d48('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7d48('0xa'));var _=require(_0x7d48('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7d48('0xc'));var deskjs=require(_0x7d48('0xd'));var toCsv=require(_0x7d48('0x9'));var querystring=require(_0x7d48('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7d48('0xf'));var qs=require(_0x7d48('0x10'));var as=require(_0x7d48('0x11'));var hardwareService=require(_0x7d48('0x12'));var logger=require(_0x7d48('0x13'))('api');var utils=require(_0x7d48('0x14'));var config=require(_0x7d48('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x58103b,_0x4e46e6){_0x4e46e6=_0x4e46e6||0xcc;return function(_0x280a1a){if(_0x280a1a){return _0x58103b[_0x7d48('0x16')](_0x4e46e6);}return _0x58103b['status'](_0x4e46e6)[_0x7d48('0x17')]();};}function respondWithResult(_0x3ac1a2,_0x2b259e){_0x2b259e=_0x2b259e||0xc8;return function(_0x56b365){if(_0x56b365){return _0x3ac1a2['status'](_0x2b259e)[_0x7d48('0x18')](_0x56b365);}};}function respondWithFilteredResult(_0xc47e1,_0x50d178){return function(_0x2b538f){if(_0x2b538f){var _0x33e7e1=typeof _0x50d178[_0x7d48('0x19')]===_0x7d48('0x1a')&&typeof _0x50d178[_0x7d48('0x1b')]===_0x7d48('0x1a');var _0x5bf2a9=_0x2b538f[_0x7d48('0x1c')];var _0x5cff98=_0x33e7e1?0x0:_0x50d178[_0x7d48('0x19')];var _0x32a5ba=_0x33e7e1?_0x2b538f[_0x7d48('0x1c')]:_0x50d178[_0x7d48('0x19')]+_0x50d178[_0x7d48('0x1b')];var _0x582878;if(_0x32a5ba>=_0x5bf2a9){_0x32a5ba=_0x5bf2a9;_0x582878=0xc8;}else{_0x582878=0xce;}_0xc47e1[_0x7d48('0x1d')](_0x582878);return _0xc47e1['set'](_0x7d48('0x1e'),_0x5cff98+'-'+_0x32a5ba+'/'+_0x5bf2a9)['json'](_0x2b538f);}return null;};}function patchUpdates(_0x2f89a8){return function(_0x564254){try{jsonpatch['apply'](_0x564254,_0x2f89a8,!![]);}catch(_0x3fa48a){return BPromise[_0x7d48('0x1f')](_0x3fa48a);}return _0x564254[_0x7d48('0x20')]();};}function saveUpdates(_0x32914f,_0x37b88b){return function(_0x28c7b2){if(_0x28c7b2){return _0x28c7b2[_0x7d48('0x21')](_0x32914f)[_0x7d48('0x22')](function(_0x54d556){return _0x54d556;});}return null;};}function removeEntity(_0x10dcd7,_0x35c83d){return function(_0x1b0b07){if(_0x1b0b07){return _0x1b0b07[_0x7d48('0x23')]()['then'](function(){_0x10dcd7[_0x7d48('0x1d')](0xcc)[_0x7d48('0x17')]();});}};}function handleEntityNotFound(_0x5ec191,_0x26510e){return function(_0x555f25){if(!_0x555f25){_0x5ec191[_0x7d48('0x16')](0x194);}return _0x555f25;};}function handleError(_0xe8d948,_0x5ec462){_0x5ec462=_0x5ec462||0x1f4;return function(_0x231941){logger[_0x7d48('0x24')](_0x231941[_0x7d48('0x25')]);if(_0x231941['name']){delete _0x231941[_0x7d48('0x26')];}_0xe8d948[_0x7d48('0x1d')](_0x5ec462)[_0x7d48('0x27')](_0x231941);};}exports['index']=function(_0x411717,_0x465293){var _0x352253={},_0x2c77fe={},_0x1b926f={'count':0x0,'rows':[]};var _0x2d2836=_['map'](db[_0x7d48('0x28')]['rawAttributes'],function(_0x5ccec6){return{'name':_0x5ccec6[_0x7d48('0x29')],'type':_0x5ccec6[_0x7d48('0x2a')][_0x7d48('0x2b')]};});_0x2c77fe['model']=_['differenceBy'](_[_0x7d48('0x2c')](_0x2d2836,_0x7d48('0x26')),[_0x7d48('0x26')]);_0x2c77fe[_0x7d48('0x2d')]=_[_0x7d48('0x2e')](_0x411717[_0x7d48('0x2d')]);_0x2c77fe[_0x7d48('0x2f')]=_[_0x7d48('0x30')](_0x2c77fe[_0x7d48('0x31')],_0x2c77fe['query']);_0x352253[_0x7d48('0x32')]=_[_0x7d48('0x30')](_0x2c77fe['model'],qs[_0x7d48('0x33')](_0x411717[_0x7d48('0x2d')][_0x7d48('0x33')]));_0x352253[_0x7d48('0x32')]=_0x352253['attributes'][_0x7d48('0x34')]?_0x352253[_0x7d48('0x32')]:_0x2c77fe[_0x7d48('0x31')];if(!_0x411717[_0x7d48('0x2d')]['hasOwnProperty']('nolimit')){_0x352253[_0x7d48('0x1b')]=qs[_0x7d48('0x1b')](_0x411717[_0x7d48('0x2d')][_0x7d48('0x1b')]);_0x352253['offset']=qs[_0x7d48('0x19')](_0x411717[_0x7d48('0x2d')][_0x7d48('0x19')]);}_0x352253[_0x7d48('0x35')]=qs[_0x7d48('0x36')](_0x411717[_0x7d48('0x2d')]['sort']);_0x352253[_0x7d48('0x37')]=qs['filters'](_[_0x7d48('0x38')](_0x411717[_0x7d48('0x2d')],_0x2c77fe[_0x7d48('0x2f')]),_0x2d2836);if(_0x411717['query'][_0x7d48('0x39')]){_0x352253[_0x7d48('0x37')]=_[_0x7d48('0x3a')](_0x352253[_0x7d48('0x37')],{'$or':_[_0x7d48('0x2c')](_0x2d2836,function(_0x4c6a48){if(_0x4c6a48['type']!=='VIRTUAL'){var _0x4bd17e={};_0x4bd17e[_0x4c6a48[_0x7d48('0x26')]]={'$like':'%'+_0x411717[_0x7d48('0x2d')][_0x7d48('0x39')]+'%'};return _0x4bd17e;}})});}_0x352253=_[_0x7d48('0x3a')]({},_0x352253,_0x411717[_0x7d48('0x3b')]);var _0x1bdeb6={'where':_0x352253[_0x7d48('0x37')]};return db[_0x7d48('0x28')][_0x7d48('0x1c')](_0x1bdeb6)[_0x7d48('0x22')](function(_0x2dee44){_0x1b926f['count']=_0x2dee44;if(_0x411717['query'][_0x7d48('0x3c')]){_0x352253['include']=[{'all':!![]}];}return db[_0x7d48('0x28')][_0x7d48('0x3d')](_0x352253);})['then'](function(_0x2fcf53){_0x1b926f[_0x7d48('0x3e')]=_0x2fcf53;return _0x1b926f;})[_0x7d48('0x22')](respondWithFilteredResult(_0x465293,_0x352253))[_0x7d48('0x3f')](handleError(_0x465293,null));};exports[_0x7d48('0x40')]=function(_0x40b140,_0x1ba106){var _0x145e30={'raw':!![],'where':{'id':_0x40b140[_0x7d48('0x41')]['id']}},_0x229679={};_0x229679[_0x7d48('0x31')]=_['keys'](db[_0x7d48('0x28')][_0x7d48('0x42')]);_0x229679[_0x7d48('0x2d')]=_[_0x7d48('0x2e')](_0x40b140[_0x7d48('0x2d')]);_0x229679[_0x7d48('0x2f')]=_[_0x7d48('0x30')](_0x229679['model'],_0x229679[_0x7d48('0x2d')]);_0x145e30[_0x7d48('0x32')]=_[_0x7d48('0x30')](_0x229679[_0x7d48('0x31')],qs[_0x7d48('0x33')](_0x40b140['query']['fields']));_0x145e30[_0x7d48('0x32')]=_0x145e30[_0x7d48('0x32')][_0x7d48('0x34')]?_0x145e30[_0x7d48('0x32')]:_0x229679[_0x7d48('0x31')];if(_0x40b140['query']['includeAll']){_0x145e30[_0x7d48('0x43')]=[{'all':!![]}];}_0x145e30=_[_0x7d48('0x3a')]({},_0x145e30,_0x40b140[_0x7d48('0x3b')]);return db[_0x7d48('0x28')][_0x7d48('0x44')](_0x145e30)[_0x7d48('0x22')](handleEntityNotFound(_0x1ba106,null))['then'](respondWithResult(_0x1ba106,null))[_0x7d48('0x3f')](handleError(_0x1ba106,null));};exports[_0x7d48('0x21')]=function(_0x46c02e,_0x40588a){if(_0x46c02e['body']['id']){delete _0x46c02e[_0x7d48('0x45')]['id'];}return db[_0x7d48('0x28')][_0x7d48('0x44')]({'where':{'id':_0x46c02e[_0x7d48('0x41')]['id']}})[_0x7d48('0x22')](handleEntityNotFound(_0x40588a,null))[_0x7d48('0x22')](saveUpdates(_0x46c02e[_0x7d48('0x45')],null))[_0x7d48('0x22')](respondWithResult(_0x40588a,null))[_0x7d48('0x3f')](handleError(_0x40588a,null));};exports[_0x7d48('0x23')]=function(_0x7ff734,_0x22bd4e){return db[_0x7d48('0x28')][_0x7d48('0x44')]({'where':{'id':_0x7ff734[_0x7d48('0x41')]['id']}})[_0x7d48('0x22')](handleEntityNotFound(_0x22bd4e,null))[_0x7d48('0x22')](removeEntity(_0x22bd4e,null))[_0x7d48('0x3f')](handleError(_0x22bd4e,null));};exports[_0x7d48('0x46')]=function(_0x38570a,_0x56be1a){var _0x1b5699;return db[_0x7d48('0x47')][_0x7d48('0x48')](function(_0xeeb80c){return db[_0x7d48('0x28')][_0x7d48('0x46')](_0x38570a[_0x7d48('0x45')],{'transaction':_0xeeb80c})['then'](function(_0x4e89ec){_0x1b5699=_0x4e89ec;var _0x4f418c={'type':db[_0x7d48('0x49')][_0x7d48('0x4a')],'transaction':_0xeeb80c};switch(_0x38570a[_0x7d48('0x45')][_0x7d48('0x2a')]){case _0x7d48('0x4b'):_0x4f418c[_0x7d48('0x2a')]=db[_0x7d48('0x49')][_0x7d48('0x4a')];break;case'number':_0x4f418c[_0x7d48('0x2a')]=db[_0x7d48('0x49')][_0x7d48('0x4c')];break;case'switch':_0x4f418c[_0x7d48('0x2a')]=db[_0x7d48('0x49')][_0x7d48('0x4d')];_0x4f418c['defaultValue']=![];break;default:}return db[_0x7d48('0x47')][_0x7d48('0x4e')][_0x7d48('0x4f')](_0x7d48('0x50'),util[_0x7d48('0x51')](_0x7d48('0x52'),_0x1b5699['id']),_0x4f418c);})[_0x7d48('0x22')](function(){return _0x1b5699;});})[_0x7d48('0x22')](respondWithResult(_0x56be1a,0xc9))[_0x7d48('0x3f')](handleError(_0x56be1a,null));};
\ No newline at end of file