Built motion from commit 1fa89557.|2.6.10
[motion2.git] / server / api / cmCustomField / cmCustomField.controller.js
index cbb93e5..1a638a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x30f6=['status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','CmCustomField','model','differenceBy','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','body','sequelize','transaction','create','Sequelize','TEXT','text','number','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x53da6c,_0x5930d4){var _0x33c828=function(_0x4f8960){while(--_0x4f8960){_0x53da6c['push'](_0x53da6c['shift']());}};_0x33c828(++_0x5930d4);}(_0x30f6,0x1ac));var _0x630f=function(_0x44d5b7,_0x38c266){_0x44d5b7=_0x44d5b7-0x0;var _0x44f102=_0x30f6[_0x44d5b7];return _0x44f102;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x630f('0x0'));var rp=require(_0x630f('0x1'));var moment=require(_0x630f('0x2'));var BPromise=require(_0x630f('0x3'));var Mustache=require(_0x630f('0x4'));var util=require('util');var path=require(_0x630f('0x5'));var sox=require(_0x630f('0x6'));var csv=require(_0x630f('0x7'));var ejs=require(_0x630f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x630f('0x9'));var squel=require(_0x630f('0xa'));var crypto=require(_0x630f('0xb'));var jsforce=require(_0x630f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x630f('0x7'));var querystring=require(_0x630f('0xd'));var Papa=require(_0x630f('0xe'));var Redis=require(_0x630f('0xf'));var authService=require(_0x630f('0x10'));var qs=require(_0x630f('0x11'));var as=require(_0x630f('0x12'));var hardwareService=require(_0x630f('0x13'));var logger=require(_0x630f('0x14'))(_0x630f('0x15'));var utils=require(_0x630f('0x16'));var config=require(_0x630f('0x17'));var licenseUtil=require(_0x630f('0x18'));var db=require(_0x630f('0x19'))['db'];function respondWithStatusCode(_0x57e526,_0x423506){_0x423506=_0x423506||0xcc;return function(_0x1dba7a){if(_0x1dba7a){return _0x57e526[_0x630f('0x1a')](_0x423506);}return _0x57e526[_0x630f('0x1b')](_0x423506)[_0x630f('0x1c')]();};}function respondWithResult(_0x2ae8dd,_0x59b8d6){_0x59b8d6=_0x59b8d6||0xc8;return function(_0x22f169){if(_0x22f169){return _0x2ae8dd[_0x630f('0x1b')](_0x59b8d6)[_0x630f('0x1d')](_0x22f169);}};}function respondWithFilteredResult(_0x58ff40,_0x5ac35c){return function(_0x839b32){if(_0x839b32){var _0x1ea237=typeof _0x5ac35c[_0x630f('0x1e')]===_0x630f('0x1f')&&typeof _0x5ac35c[_0x630f('0x20')]==='undefined';var _0x46c747=_0x839b32[_0x630f('0x21')];var _0x1388ef=_0x1ea237?0x0:_0x5ac35c[_0x630f('0x1e')];var _0x18ca93=_0x1ea237?_0x839b32[_0x630f('0x21')]:_0x5ac35c[_0x630f('0x1e')]+_0x5ac35c['limit'];var _0x383951;if(_0x18ca93>=_0x46c747){_0x18ca93=_0x46c747;_0x383951=0xc8;}else{_0x383951=0xce;}_0x58ff40['status'](_0x383951);return _0x58ff40[_0x630f('0x22')](_0x630f('0x23'),_0x1388ef+'-'+_0x18ca93+'/'+_0x46c747)[_0x630f('0x1d')](_0x839b32);}return null;};}function patchUpdates(_0x81f344){return function(_0xd9480e){try{jsonpatch[_0x630f('0x24')](_0xd9480e,_0x81f344,!![]);}catch(_0x136fd6){return BPromise[_0x630f('0x25')](_0x136fd6);}return _0xd9480e[_0x630f('0x26')]();};}function saveUpdates(_0x21e04c,_0x396a58){return function(_0x6cf7b8){if(_0x6cf7b8){return _0x6cf7b8[_0x630f('0x27')](_0x21e04c)[_0x630f('0x28')](function(_0x45d171){return _0x45d171;});}return null;};}function removeEntity(_0x3bd679,_0x1aa7dc){return function(_0x4912d6){if(_0x4912d6){return _0x4912d6['destroy']()[_0x630f('0x28')](function(){_0x3bd679[_0x630f('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a0c54,_0xbd296a){return function(_0x3c0035){if(!_0x3c0035){_0x3a0c54[_0x630f('0x1a')](0x194);}return _0x3c0035;};}function handleError(_0x1add50,_0x3642f0){_0x3642f0=_0x3642f0||0x1f4;return function(_0x529737){logger[_0x630f('0x29')](_0x529737[_0x630f('0x2a')]);if(_0x529737['name']){delete _0x529737[_0x630f('0x2b')];}_0x1add50[_0x630f('0x1b')](_0x3642f0)[_0x630f('0x2c')](_0x529737);};}exports[_0x630f('0x2d')]=function(_0x20fe4c,_0x4e5b6d){var _0x20392e={},_0x190703={},_0x194e6b={'count':0x0,'rows':[]};var _0x20eba5=_['map'](db[_0x630f('0x2e')]['rawAttributes'],function(_0x1a9d05){return{'name':_0x1a9d05['fieldName'],'type':_0x1a9d05['type']['key']};});_0x190703[_0x630f('0x2f')]=_[_0x630f('0x30')](_[_0x630f('0x31')](_0x20eba5,'name'),[_0x630f('0x2b')]);_0x190703[_0x630f('0x32')]=_['keys'](_0x20fe4c[_0x630f('0x32')]);_0x190703[_0x630f('0x33')]=_[_0x630f('0x34')](_0x190703[_0x630f('0x2f')],_0x190703[_0x630f('0x32')]);_0x20392e['attributes']=_[_0x630f('0x34')](_0x190703[_0x630f('0x2f')],qs['fields'](_0x20fe4c['query'][_0x630f('0x35')]));_0x20392e[_0x630f('0x36')]=_0x20392e[_0x630f('0x36')][_0x630f('0x37')]?_0x20392e[_0x630f('0x36')]:_0x190703[_0x630f('0x2f')];if(!_0x20fe4c[_0x630f('0x32')][_0x630f('0x38')](_0x630f('0x39'))){_0x20392e[_0x630f('0x20')]=qs[_0x630f('0x20')](_0x20fe4c[_0x630f('0x32')][_0x630f('0x20')]);_0x20392e[_0x630f('0x1e')]=qs['offset'](_0x20fe4c[_0x630f('0x32')][_0x630f('0x1e')]);}_0x20392e[_0x630f('0x3a')]=qs[_0x630f('0x3b')](_0x20fe4c['query'][_0x630f('0x3b')]);_0x20392e[_0x630f('0x3c')]=qs[_0x630f('0x33')](_['pick'](_0x20fe4c[_0x630f('0x32')],_0x190703[_0x630f('0x33')]),_0x20eba5);if(_0x20fe4c[_0x630f('0x32')][_0x630f('0x3d')]){_0x20392e['where']=_[_0x630f('0x3e')](_0x20392e['where'],{'$or':_[_0x630f('0x31')](_0x20eba5,function(_0x5f8b1d){if(_0x5f8b1d[_0x630f('0x3f')]!==_0x630f('0x40')){var _0x150904={};_0x150904[_0x5f8b1d[_0x630f('0x2b')]]={'$like':'%'+_0x20fe4c[_0x630f('0x32')][_0x630f('0x3d')]+'%'};return _0x150904;}})});}_0x20392e=_[_0x630f('0x3e')]({},_0x20392e,_0x20fe4c[_0x630f('0x41')]);var _0x3f6e7e={'where':_0x20392e['where']};return db[_0x630f('0x2e')][_0x630f('0x21')](_0x3f6e7e)[_0x630f('0x28')](function(_0x3e7e82){_0x194e6b['count']=_0x3e7e82;if(_0x20fe4c[_0x630f('0x32')][_0x630f('0x42')]){_0x20392e[_0x630f('0x43')]=[{'all':!![]}];}return db[_0x630f('0x2e')][_0x630f('0x44')](_0x20392e);})[_0x630f('0x28')](function(_0x4c422e){_0x194e6b[_0x630f('0x45')]=_0x4c422e;return _0x194e6b;})[_0x630f('0x28')](respondWithFilteredResult(_0x4e5b6d,_0x20392e))[_0x630f('0x46')](handleError(_0x4e5b6d,null));};exports[_0x630f('0x47')]=function(_0x43e27f,_0x341709){var _0x29c50c={'raw':!![],'where':{'id':_0x43e27f[_0x630f('0x48')]['id']}},_0x296fac={};_0x296fac[_0x630f('0x2f')]=_[_0x630f('0x49')](db[_0x630f('0x2e')][_0x630f('0x4a')]);_0x296fac[_0x630f('0x32')]=_[_0x630f('0x49')](_0x43e27f[_0x630f('0x32')]);_0x296fac['filters']=_[_0x630f('0x34')](_0x296fac[_0x630f('0x2f')],_0x296fac['query']);_0x29c50c[_0x630f('0x36')]=_[_0x630f('0x34')](_0x296fac[_0x630f('0x2f')],qs[_0x630f('0x35')](_0x43e27f[_0x630f('0x32')][_0x630f('0x35')]));_0x29c50c[_0x630f('0x36')]=_0x29c50c['attributes']['length']?_0x29c50c[_0x630f('0x36')]:_0x296fac['model'];if(_0x43e27f[_0x630f('0x32')][_0x630f('0x42')]){_0x29c50c[_0x630f('0x43')]=[{'all':!![]}];}_0x29c50c=_['merge']({},_0x29c50c,_0x43e27f[_0x630f('0x41')]);return db[_0x630f('0x2e')][_0x630f('0x4b')](_0x29c50c)[_0x630f('0x28')](handleEntityNotFound(_0x341709,null))[_0x630f('0x28')](respondWithResult(_0x341709,null))[_0x630f('0x46')](handleError(_0x341709,null));};exports['update']=function(_0xfe7452,_0x5a854c){if(_0xfe7452[_0x630f('0x4c')]['id']){delete _0xfe7452[_0x630f('0x4c')]['id'];}return db[_0x630f('0x2e')][_0x630f('0x4b')]({'where':{'id':_0xfe7452['params']['id']}})[_0x630f('0x28')](handleEntityNotFound(_0x5a854c,null))['then'](saveUpdates(_0xfe7452[_0x630f('0x4c')],null))[_0x630f('0x28')](respondWithResult(_0x5a854c,null))['catch'](handleError(_0x5a854c,null));};exports['destroy']=function(_0x321d4e,_0x4972bb){return db[_0x630f('0x2e')][_0x630f('0x4b')]({'where':{'id':_0x321d4e['params']['id']}})['then'](handleEntityNotFound(_0x4972bb,null))[_0x630f('0x28')](removeEntity(_0x4972bb,null))[_0x630f('0x46')](handleError(_0x4972bb,null));};exports['create']=function(_0x4d8848,_0x16ce9b){var _0x40dce3;return db[_0x630f('0x4d')][_0x630f('0x4e')](function(_0xa2ed82){return db[_0x630f('0x2e')][_0x630f('0x4f')](_0x4d8848[_0x630f('0x4c')],{'transaction':_0xa2ed82})['then'](function(_0x4b2683){_0x40dce3=_0x4b2683;var _0x1f78a4={'type':db[_0x630f('0x50')][_0x630f('0x51')],'transaction':_0xa2ed82};switch(_0x4d8848['body']['type']){case _0x630f('0x52'):_0x1f78a4[_0x630f('0x3f')]=db[_0x630f('0x50')][_0x630f('0x51')];break;case _0x630f('0x53'):_0x1f78a4[_0x630f('0x3f')]=db[_0x630f('0x50')]['INTEGER'];break;case _0x630f('0x54'):_0x1f78a4[_0x630f('0x3f')]=db['Sequelize'][_0x630f('0x55')];_0x1f78a4[_0x630f('0x56')]=![];break;default:}return db[_0x630f('0x4d')][_0x630f('0x57')][_0x630f('0x58')](_0x630f('0x59'),util[_0x630f('0x5a')]('cf_%d',_0x40dce3['id']),_0x1f78a4);})[_0x630f('0x28')](function(){return _0x40dce3;});})[_0x630f('0x28')](respondWithResult(_0x16ce9b,0xc9))[_0x630f('0x46')](handleError(_0x16ce9b,null));};
\ No newline at end of file
+var _0x03c8=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','name','status','send','index','map','CmCustomField','rawAttributes','type','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','filter','merge','options','where','findAll','show','params','includeAll','include','find','catch','body','create','sequelize','transaction','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','cm_contacts','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x03c8,0x9d));var _0x803c=function(_0x2f43f2,_0x1fa28e){_0x2f43f2=_0x2f43f2-0x0;var _0xd811e9=_0x03c8[_0x2f43f2];return _0xd811e9;};'use strict';var emlformat=require(_0x803c('0x0'));var rimraf=require(_0x803c('0x1'));var zipdir=require(_0x803c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x803c('0x3'));var moment=require(_0x803c('0x4'));var BPromise=require(_0x803c('0x5'));var Mustache=require(_0x803c('0x6'));var util=require(_0x803c('0x7'));var path=require(_0x803c('0x8'));var sox=require(_0x803c('0x9'));var csv=require('to-csv');var ejs=require(_0x803c('0xa'));var fs=require('fs');var fs_extra=require(_0x803c('0xb'));var _=require(_0x803c('0xc'));var squel=require(_0x803c('0xd'));var crypto=require(_0x803c('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x803c('0xf'));var querystring=require(_0x803c('0x10'));var Papa=require(_0x803c('0x11'));var Redis=require('ioredis');var authService=require(_0x803c('0x12'));var qs=require(_0x803c('0x13'));var as=require(_0x803c('0x14'));var hardwareService=require(_0x803c('0x15'));var logger=require(_0x803c('0x16'))(_0x803c('0x17'));var utils=require(_0x803c('0x18'));var config=require(_0x803c('0x19'));var licenseUtil=require(_0x803c('0x1a'));var db=require(_0x803c('0x1b'))['db'];function respondWithStatusCode(_0x488d00,_0x51c57d){_0x51c57d=_0x51c57d||0xcc;return function(_0x12f3e4){if(_0x12f3e4){return _0x488d00['sendStatus'](_0x51c57d);}return _0x488d00['status'](_0x51c57d)[_0x803c('0x1c')]();};}function respondWithResult(_0x47d62d,_0x29ac11){_0x29ac11=_0x29ac11||0xc8;return function(_0x10608d){if(_0x10608d){return _0x47d62d['status'](_0x29ac11)['json'](_0x10608d);}};}function respondWithFilteredResult(_0x42928f,_0x53fad6){return function(_0xd45383){if(_0xd45383){var _0x3a2e70=typeof _0x53fad6[_0x803c('0x1d')]===_0x803c('0x1e')&&typeof _0x53fad6['limit']==='undefined';var _0x21e707=_0xd45383[_0x803c('0x1f')];var _0x32e253=_0x3a2e70?0x0:_0x53fad6[_0x803c('0x1d')];var _0x212c28=_0x3a2e70?_0xd45383[_0x803c('0x1f')]:_0x53fad6[_0x803c('0x1d')]+_0x53fad6[_0x803c('0x20')];var _0x373ed2;if(_0x212c28>=_0x21e707){_0x212c28=_0x21e707;_0x373ed2=0xc8;}else{_0x373ed2=0xce;}_0x42928f['status'](_0x373ed2);return _0x42928f[_0x803c('0x21')](_0x803c('0x22'),_0x32e253+'-'+_0x212c28+'/'+_0x21e707)[_0x803c('0x23')](_0xd45383);}return null;};}function patchUpdates(_0x5dc7f4){return function(_0x6fc3e3){try{jsonpatch[_0x803c('0x24')](_0x6fc3e3,_0x5dc7f4,!![]);}catch(_0x3836d3){return BPromise[_0x803c('0x25')](_0x3836d3);}return _0x6fc3e3[_0x803c('0x26')]();};}function saveUpdates(_0x2753b0,_0x4b1d27){return function(_0x116626){if(_0x116626){return _0x116626[_0x803c('0x27')](_0x2753b0)[_0x803c('0x28')](function(_0x23c9f8){return _0x23c9f8;});}return null;};}function removeEntity(_0x1f91f4,_0x4aa2e7){return function(_0x1ad1ce){if(_0x1ad1ce){return _0x1ad1ce[_0x803c('0x29')]()[_0x803c('0x28')](function(){_0x1f91f4['status'](0xcc)[_0x803c('0x1c')]();});}};}function handleEntityNotFound(_0x432db8,_0x344301){return function(_0x262da6){if(!_0x262da6){_0x432db8[_0x803c('0x2a')](0x194);}return _0x262da6;};}function handleError(_0x634b5f,_0x101148){_0x101148=_0x101148||0x1f4;return function(_0x1a3c89){logger[_0x803c('0x2b')](_0x1a3c89['stack']);if(_0x1a3c89[_0x803c('0x2c')]){delete _0x1a3c89[_0x803c('0x2c')];}_0x634b5f[_0x803c('0x2d')](_0x101148)[_0x803c('0x2e')](_0x1a3c89);};}exports[_0x803c('0x2f')]=function(_0x45fe62,_0x3c1594){var _0x6e5d4b={},_0x4f4679={},_0x2fe7a6={'count':0x0,'rows':[]};var _0x588e1c=_[_0x803c('0x30')](db[_0x803c('0x31')][_0x803c('0x32')],function(_0x414715){return{'name':_0x414715['fieldName'],'type':_0x414715[_0x803c('0x33')][_0x803c('0x34')]};});_0x4f4679[_0x803c('0x35')]=_[_0x803c('0x36')](_[_0x803c('0x30')](_0x588e1c,_0x803c('0x2c')),[_0x803c('0x2c')]);_0x4f4679[_0x803c('0x37')]=_[_0x803c('0x38')](_0x45fe62[_0x803c('0x37')]);_0x4f4679[_0x803c('0x39')]=_[_0x803c('0x3a')](_0x4f4679[_0x803c('0x35')],_0x4f4679['query']);_0x6e5d4b[_0x803c('0x3b')]=_[_0x803c('0x3a')](_0x4f4679[_0x803c('0x35')],qs['fields'](_0x45fe62['query'][_0x803c('0x3c')]));_0x6e5d4b[_0x803c('0x3b')]=_0x6e5d4b[_0x803c('0x3b')][_0x803c('0x3d')]?_0x6e5d4b['attributes']:_0x4f4679[_0x803c('0x35')];if(!_0x45fe62['query'][_0x803c('0x3e')]('nolimit')){_0x6e5d4b[_0x803c('0x20')]=qs[_0x803c('0x20')](_0x45fe62['query'][_0x803c('0x20')]);_0x6e5d4b[_0x803c('0x1d')]=qs['offset'](_0x45fe62[_0x803c('0x37')][_0x803c('0x1d')]);}_0x6e5d4b[_0x803c('0x3f')]=qs['sort'](_0x45fe62[_0x803c('0x37')]['sort']);_0x6e5d4b['where']=qs[_0x803c('0x39')](_['pick'](_0x45fe62['query'],_0x4f4679[_0x803c('0x39')]),_0x588e1c);if(_0x45fe62['query'][_0x803c('0x40')]){_0x6e5d4b['where']=_[_0x803c('0x41')](_0x6e5d4b['where'],{'$or':_['map'](_0x588e1c,function(_0x5186a2){if(_0x5186a2[_0x803c('0x33')]!=='VIRTUAL'){var _0x857120={};_0x857120[_0x5186a2['name']]={'$like':'%'+_0x45fe62[_0x803c('0x37')][_0x803c('0x40')]+'%'};return _0x857120;}})});}_0x6e5d4b=_[_0x803c('0x41')]({},_0x6e5d4b,_0x45fe62[_0x803c('0x42')]);var _0xcf798d={'where':_0x6e5d4b[_0x803c('0x43')]};return db[_0x803c('0x31')]['count'](_0xcf798d)[_0x803c('0x28')](function(_0x311a7e){_0x2fe7a6['count']=_0x311a7e;if(_0x45fe62['query']['includeAll']){_0x6e5d4b['include']=[{'all':!![]}];}return db['CmCustomField'][_0x803c('0x44')](_0x6e5d4b);})['then'](function(_0x1ed9d9){_0x2fe7a6['rows']=_0x1ed9d9;return _0x2fe7a6;})[_0x803c('0x28')](respondWithFilteredResult(_0x3c1594,_0x6e5d4b))['catch'](handleError(_0x3c1594,null));};exports[_0x803c('0x45')]=function(_0x2fa7c9,_0x3a3238){var _0x4748f9={'raw':!![],'where':{'id':_0x2fa7c9[_0x803c('0x46')]['id']}},_0x465f7b={};_0x465f7b[_0x803c('0x35')]=_[_0x803c('0x38')](db[_0x803c('0x31')]['rawAttributes']);_0x465f7b[_0x803c('0x37')]=_[_0x803c('0x38')](_0x2fa7c9[_0x803c('0x37')]);_0x465f7b[_0x803c('0x39')]=_['intersection'](_0x465f7b[_0x803c('0x35')],_0x465f7b[_0x803c('0x37')]);_0x4748f9[_0x803c('0x3b')]=_[_0x803c('0x3a')](_0x465f7b[_0x803c('0x35')],qs['fields'](_0x2fa7c9[_0x803c('0x37')]['fields']));_0x4748f9['attributes']=_0x4748f9[_0x803c('0x3b')]['length']?_0x4748f9[_0x803c('0x3b')]:_0x465f7b[_0x803c('0x35')];if(_0x2fa7c9['query'][_0x803c('0x47')]){_0x4748f9[_0x803c('0x48')]=[{'all':!![]}];}_0x4748f9=_[_0x803c('0x41')]({},_0x4748f9,_0x2fa7c9[_0x803c('0x42')]);return db['CmCustomField'][_0x803c('0x49')](_0x4748f9)[_0x803c('0x28')](handleEntityNotFound(_0x3a3238,null))[_0x803c('0x28')](respondWithResult(_0x3a3238,null))[_0x803c('0x4a')](handleError(_0x3a3238,null));};exports[_0x803c('0x27')]=function(_0x4e3fe8,_0x3e0aa6){if(_0x4e3fe8[_0x803c('0x4b')]['id']){delete _0x4e3fe8['body']['id'];}return db[_0x803c('0x31')]['find']({'where':{'id':_0x4e3fe8[_0x803c('0x46')]['id']}})[_0x803c('0x28')](handleEntityNotFound(_0x3e0aa6,null))[_0x803c('0x28')](saveUpdates(_0x4e3fe8[_0x803c('0x4b')],null))[_0x803c('0x28')](respondWithResult(_0x3e0aa6,null))[_0x803c('0x4a')](handleError(_0x3e0aa6,null));};exports[_0x803c('0x29')]=function(_0x2ec2e7,_0x174ff7){return db[_0x803c('0x31')][_0x803c('0x49')]({'where':{'id':_0x2ec2e7[_0x803c('0x46')]['id']}})['then'](handleEntityNotFound(_0x174ff7,null))['then'](removeEntity(_0x174ff7,null))[_0x803c('0x4a')](handleError(_0x174ff7,null));};exports[_0x803c('0x4c')]=function(_0x1c4bf2,_0x2e56dc){var _0x5a85af;return db[_0x803c('0x4d')][_0x803c('0x4e')](function(_0xc11fc7){return db[_0x803c('0x31')]['create'](_0x1c4bf2[_0x803c('0x4b')],{'transaction':_0xc11fc7})[_0x803c('0x28')](function(_0xc5a578){_0x5a85af=_0xc5a578;var _0x29c1e8={'type':db[_0x803c('0x4f')][_0x803c('0x50')],'transaction':_0xc11fc7};switch(_0x1c4bf2['body'][_0x803c('0x33')]){case _0x803c('0x51'):_0x29c1e8[_0x803c('0x33')]=db['Sequelize'][_0x803c('0x50')];break;case _0x803c('0x52'):_0x29c1e8[_0x803c('0x33')]=db[_0x803c('0x4f')][_0x803c('0x53')];break;case _0x803c('0x54'):_0x29c1e8[_0x803c('0x33')]=db[_0x803c('0x4f')][_0x803c('0x55')];_0x29c1e8[_0x803c('0x56')]=![];break;default:}return db[_0x803c('0x4d')][_0x803c('0x57')]['addColumn'](_0x803c('0x58'),util['format']('cf_%d',_0x5a85af['id']),_0x29c1e8);})[_0x803c('0x28')](function(){return _0x5a85af;});})[_0x803c('0x28')](respondWithResult(_0x2e56dc,0xc9))['catch'](handleError(_0x2e56dc,null));};
\ No newline at end of file