Built motion from commit 9d0783e6.|2.6.13
[motion2.git] / server / api / cmCustomField / cmCustomField.controller.js
index 2d06853..fb8e97b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf75f=['sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','include','find','body','destroy','create','sequelize','transaction','TEXT','text','Sequelize','INTEGER','switch','queryInterface','cm_contacts','format','cf_%d','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','limit','count','set','Content-Range','apply','save','update','then','error','stack','name','send','index','map','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x3789c7,_0x3a156d){var _0x3b58ca=function(_0x146600){while(--_0x146600){_0x3789c7['push'](_0x3789c7['shift']());}};_0x3b58ca(++_0x3a156d);}(_0xf75f,0x1ca));var _0xff75=function(_0x109072,_0x1a7c92){_0x109072=_0x109072-0x0;var _0x25a30e=_0xf75f[_0x109072];return _0x25a30e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xff75('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xff75('0x1'));var rp=require(_0xff75('0x2'));var moment=require(_0xff75('0x3'));var BPromise=require(_0xff75('0x4'));var Mustache=require(_0xff75('0x5'));var util=require(_0xff75('0x6'));var path=require(_0xff75('0x7'));var sox=require(_0xff75('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xff75('0x9'));var _=require(_0xff75('0xa'));var squel=require(_0xff75('0xb'));var crypto=require(_0xff75('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xff75('0xd'));var querystring=require('querystring');var Papa=require(_0xff75('0xe'));var Redis=require(_0xff75('0xf'));var authService=require(_0xff75('0x10'));var qs=require(_0xff75('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xff75('0x12'));var logger=require(_0xff75('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xff75('0x14'));var licenseUtil=require(_0xff75('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x393c62,_0x352846){_0x352846=_0x352846||0xcc;return function(_0x5575a1){if(_0x5575a1){return _0x393c62[_0xff75('0x16')](_0x352846);}return _0x393c62['status'](_0x352846)[_0xff75('0x17')]();};}function respondWithResult(_0x3a4587,_0x4ccac9){_0x4ccac9=_0x4ccac9||0xc8;return function(_0x5f149f){if(_0x5f149f){return _0x3a4587[_0xff75('0x18')](_0x4ccac9)[_0xff75('0x19')](_0x5f149f);}};}function respondWithFilteredResult(_0x5d049c,_0x15bcc5){return function(_0x167357){if(_0x167357){var _0x583d19=typeof _0x15bcc5[_0xff75('0x1a')]==='undefined'&&typeof _0x15bcc5[_0xff75('0x1b')]==='undefined';var _0x13d01b=_0x167357['count'];var _0x5a9789=_0x583d19?0x0:_0x15bcc5['offset'];var _0x20065e=_0x583d19?_0x167357[_0xff75('0x1c')]:_0x15bcc5[_0xff75('0x1a')]+_0x15bcc5[_0xff75('0x1b')];var _0x3915ea;if(_0x20065e>=_0x13d01b){_0x20065e=_0x13d01b;_0x3915ea=0xc8;}else{_0x3915ea=0xce;}_0x5d049c['status'](_0x3915ea);return _0x5d049c[_0xff75('0x1d')](_0xff75('0x1e'),_0x5a9789+'-'+_0x20065e+'/'+_0x13d01b)[_0xff75('0x19')](_0x167357);}return null;};}function patchUpdates(_0x35a59d){return function(_0x57fbdd){try{jsonpatch[_0xff75('0x1f')](_0x57fbdd,_0x35a59d,!![]);}catch(_0x47b2aa){return BPromise['reject'](_0x47b2aa);}return _0x57fbdd[_0xff75('0x20')]();};}function saveUpdates(_0x5a78e1,_0x58e89a){return function(_0x332d5f){if(_0x332d5f){return _0x332d5f[_0xff75('0x21')](_0x5a78e1)[_0xff75('0x22')](function(_0x5e5e59){return _0x5e5e59;});}return null;};}function removeEntity(_0x405755,_0x5bf075){return function(_0x56d738){if(_0x56d738){return _0x56d738['destroy']()[_0xff75('0x22')](function(){_0x405755[_0xff75('0x18')](0xcc)[_0xff75('0x17')]();});}};}function handleEntityNotFound(_0x4e294c,_0x3e8c7c){return function(_0x369593){if(!_0x369593){_0x4e294c[_0xff75('0x16')](0x194);}return _0x369593;};}function handleError(_0x1608fa,_0x52bf4c){_0x52bf4c=_0x52bf4c||0x1f4;return function(_0x34768c){logger[_0xff75('0x23')](_0x34768c[_0xff75('0x24')]);if(_0x34768c['name']){delete _0x34768c[_0xff75('0x25')];}_0x1608fa[_0xff75('0x18')](_0x52bf4c)[_0xff75('0x26')](_0x34768c);};}exports[_0xff75('0x27')]=function(_0x48070c,_0xda428d){var _0x176488={},_0x18b63b={},_0x5ed173={'count':0x0,'rows':[]};var _0x14a752=_[_0xff75('0x28')](db[_0xff75('0x29')][_0xff75('0x2a')],function(_0x101286){return{'name':_0x101286[_0xff75('0x2b')],'type':_0x101286[_0xff75('0x2c')][_0xff75('0x2d')]};});_0x18b63b[_0xff75('0x2e')]=_[_0xff75('0x2f')](_[_0xff75('0x28')](_0x14a752,'name'),['name']);_0x18b63b[_0xff75('0x30')]=_[_0xff75('0x31')](_0x48070c[_0xff75('0x30')]);_0x18b63b[_0xff75('0x32')]=_[_0xff75('0x33')](_0x18b63b[_0xff75('0x2e')],_0x18b63b['query']);_0x176488[_0xff75('0x34')]=_[_0xff75('0x33')](_0x18b63b[_0xff75('0x2e')],qs[_0xff75('0x35')](_0x48070c[_0xff75('0x30')][_0xff75('0x35')]));_0x176488[_0xff75('0x34')]=_0x176488[_0xff75('0x34')][_0xff75('0x36')]?_0x176488[_0xff75('0x34')]:_0x18b63b['model'];if(!_0x48070c['query'][_0xff75('0x37')](_0xff75('0x38'))){_0x176488[_0xff75('0x1b')]=qs['limit'](_0x48070c[_0xff75('0x30')][_0xff75('0x1b')]);_0x176488[_0xff75('0x1a')]=qs[_0xff75('0x1a')](_0x48070c[_0xff75('0x30')]['offset']);}_0x176488[_0xff75('0x39')]=qs[_0xff75('0x3a')](_0x48070c[_0xff75('0x30')][_0xff75('0x3a')]);_0x176488[_0xff75('0x3b')]=qs[_0xff75('0x32')](_[_0xff75('0x3c')](_0x48070c[_0xff75('0x30')],_0x18b63b[_0xff75('0x32')]),_0x14a752);if(_0x48070c[_0xff75('0x30')][_0xff75('0x3d')]){_0x176488[_0xff75('0x3b')]=_['merge'](_0x176488[_0xff75('0x3b')],{'$or':_[_0xff75('0x28')](_0x14a752,function(_0x57fd31){if(_0x57fd31[_0xff75('0x2c')]!=='VIRTUAL'){var _0x2a5845={};_0x2a5845[_0x57fd31[_0xff75('0x25')]]={'$like':'%'+_0x48070c[_0xff75('0x30')][_0xff75('0x3d')]+'%'};return _0x2a5845;}})});}_0x176488=_[_0xff75('0x3e')]({},_0x176488,_0x48070c[_0xff75('0x3f')]);var _0x293547={'where':_0x176488[_0xff75('0x3b')]};return db[_0xff75('0x29')][_0xff75('0x1c')](_0x293547)[_0xff75('0x22')](function(_0x32c234){_0x5ed173[_0xff75('0x1c')]=_0x32c234;if(_0x48070c[_0xff75('0x30')][_0xff75('0x40')]){_0x176488['include']=[{'all':!![]}];}return db[_0xff75('0x29')][_0xff75('0x41')](_0x176488);})[_0xff75('0x22')](function(_0x13e62c){_0x5ed173[_0xff75('0x42')]=_0x13e62c;return _0x5ed173;})['then'](respondWithFilteredResult(_0xda428d,_0x176488))[_0xff75('0x43')](handleError(_0xda428d,null));};exports[_0xff75('0x44')]=function(_0x128f97,_0x4a1b51){var _0x35228a={'raw':!![],'where':{'id':_0x128f97[_0xff75('0x45')]['id']}},_0x3d627f={};_0x3d627f['model']=_[_0xff75('0x31')](db[_0xff75('0x29')][_0xff75('0x2a')]);_0x3d627f['query']=_[_0xff75('0x31')](_0x128f97['query']);_0x3d627f[_0xff75('0x32')]=_[_0xff75('0x33')](_0x3d627f['model'],_0x3d627f[_0xff75('0x30')]);_0x35228a[_0xff75('0x34')]=_[_0xff75('0x33')](_0x3d627f[_0xff75('0x2e')],qs[_0xff75('0x35')](_0x128f97[_0xff75('0x30')][_0xff75('0x35')]));_0x35228a['attributes']=_0x35228a[_0xff75('0x34')]['length']?_0x35228a[_0xff75('0x34')]:_0x3d627f[_0xff75('0x2e')];if(_0x128f97['query'][_0xff75('0x40')]){_0x35228a[_0xff75('0x46')]=[{'all':!![]}];}_0x35228a=_['merge']({},_0x35228a,_0x128f97[_0xff75('0x3f')]);return db['CmCustomField'][_0xff75('0x47')](_0x35228a)[_0xff75('0x22')](handleEntityNotFound(_0x4a1b51,null))[_0xff75('0x22')](respondWithResult(_0x4a1b51,null))[_0xff75('0x43')](handleError(_0x4a1b51,null));};exports[_0xff75('0x21')]=function(_0x44646d,_0x45ab1e){if(_0x44646d[_0xff75('0x48')]['id']){delete _0x44646d[_0xff75('0x48')]['id'];}return db['CmCustomField'][_0xff75('0x47')]({'where':{'id':_0x44646d[_0xff75('0x45')]['id']}})[_0xff75('0x22')](handleEntityNotFound(_0x45ab1e,null))['then'](saveUpdates(_0x44646d[_0xff75('0x48')],null))[_0xff75('0x22')](respondWithResult(_0x45ab1e,null))[_0xff75('0x43')](handleError(_0x45ab1e,null));};exports[_0xff75('0x49')]=function(_0x33e040,_0x162c46){return db['CmCustomField']['find']({'where':{'id':_0x33e040[_0xff75('0x45')]['id']}})[_0xff75('0x22')](handleEntityNotFound(_0x162c46,null))[_0xff75('0x22')](removeEntity(_0x162c46,null))[_0xff75('0x43')](handleError(_0x162c46,null));};exports[_0xff75('0x4a')]=function(_0x1e3c9e,_0x4c5514){var _0x1a5cff;return db[_0xff75('0x4b')][_0xff75('0x4c')](function(_0x5324b8){return db['CmCustomField'][_0xff75('0x4a')](_0x1e3c9e[_0xff75('0x48')],{'transaction':_0x5324b8})['then'](function(_0xbacb41){_0x1a5cff=_0xbacb41;var _0x292c8a={'type':db['Sequelize'][_0xff75('0x4d')],'transaction':_0x5324b8};switch(_0x1e3c9e[_0xff75('0x48')][_0xff75('0x2c')]){case _0xff75('0x4e'):_0x292c8a[_0xff75('0x2c')]=db[_0xff75('0x4f')][_0xff75('0x4d')];break;case'number':_0x292c8a[_0xff75('0x2c')]=db[_0xff75('0x4f')][_0xff75('0x50')];break;case _0xff75('0x51'):_0x292c8a[_0xff75('0x2c')]=db['Sequelize']['BOOLEAN'];_0x292c8a['defaultValue']=![];break;default:}return db[_0xff75('0x4b')][_0xff75('0x52')]['addColumn'](_0xff75('0x53'),util[_0xff75('0x54')](_0xff75('0x55'),_0x1a5cff['id']),_0x292c8a);})[_0xff75('0x22')](function(){return _0x1a5cff;});})[_0xff75('0x22')](respondWithResult(_0x4c5514,0xc9))[_0xff75('0x43')](handleError(_0x4c5514,null));};
\ No newline at end of file
+var _0x962b=['params','include','body','find','create','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','cm_contacts','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','json','apply','reject','save','update','destroy','then','error','name','index','rawAttributes','fieldName','type','model','differenceBy','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','map','VIRTUAL','filter','CmCustomField','includeAll','findAll','rows','catch','show'];(function(_0x2cd99c,_0x1ee4ff){var _0x192867=function(_0x19dc87){while(--_0x19dc87){_0x2cd99c['push'](_0x2cd99c['shift']());}};_0x192867(++_0x1ee4ff);}(_0x962b,0xba));var _0xb962=function(_0x31f5f4,_0x3f177){_0x31f5f4=_0x31f5f4-0x0;var _0x432fd2=_0x962b[_0x31f5f4];return _0x432fd2;};'use strict';var emlformat=require(_0xb962('0x0'));var rimraf=require(_0xb962('0x1'));var zipdir=require(_0xb962('0x2'));var jsonpatch=require(_0xb962('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb962('0x4'));var util=require(_0xb962('0x5'));var path=require('path');var sox=require(_0xb962('0x6'));var csv=require(_0xb962('0x7'));var ejs=require(_0xb962('0x8'));var fs=require('fs');var fs_extra=require(_0xb962('0x9'));var _=require(_0xb962('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb962('0xb'));var deskjs=require(_0xb962('0xc'));var toCsv=require(_0xb962('0x7'));var querystring=require('querystring');var Papa=require(_0xb962('0xd'));var Redis=require(_0xb962('0xe'));var authService=require(_0xb962('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xb962('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb962('0x11'))('api');var utils=require(_0xb962('0x12'));var config=require(_0xb962('0x13'));var licenseUtil=require(_0xb962('0x14'));var db=require(_0xb962('0x15'))['db'];function respondWithStatusCode(_0x30f0cb,_0x8c3772){_0x8c3772=_0x8c3772||0xcc;return function(_0x5aba87){if(_0x5aba87){return _0x30f0cb[_0xb962('0x16')](_0x8c3772);}return _0x30f0cb[_0xb962('0x17')](_0x8c3772)[_0xb962('0x18')]();};}function respondWithResult(_0x3c1994,_0x26c597){_0x26c597=_0x26c597||0xc8;return function(_0x3805c8){if(_0x3805c8){return _0x3c1994[_0xb962('0x17')](_0x26c597)['json'](_0x3805c8);}};}function respondWithFilteredResult(_0x37f2fd,_0x54f063){return function(_0xec1af1){if(_0xec1af1){var _0xfa36b0=typeof _0x54f063[_0xb962('0x19')]===_0xb962('0x1a')&&typeof _0x54f063[_0xb962('0x1b')]===_0xb962('0x1a');var _0x24e63c=_0xec1af1[_0xb962('0x1c')];var _0x152dff=_0xfa36b0?0x0:_0x54f063[_0xb962('0x19')];var _0x4885b6=_0xfa36b0?_0xec1af1[_0xb962('0x1c')]:_0x54f063[_0xb962('0x19')]+_0x54f063[_0xb962('0x1b')];var _0x3ff531;if(_0x4885b6>=_0x24e63c){_0x4885b6=_0x24e63c;_0x3ff531=0xc8;}else{_0x3ff531=0xce;}_0x37f2fd[_0xb962('0x17')](_0x3ff531);return _0x37f2fd['set']('Content-Range',_0x152dff+'-'+_0x4885b6+'/'+_0x24e63c)[_0xb962('0x1d')](_0xec1af1);}return null;};}function patchUpdates(_0x4acb02){return function(_0xfc7ffd){try{jsonpatch[_0xb962('0x1e')](_0xfc7ffd,_0x4acb02,!![]);}catch(_0x48d7e9){return BPromise[_0xb962('0x1f')](_0x48d7e9);}return _0xfc7ffd[_0xb962('0x20')]();};}function saveUpdates(_0x7e6c17,_0x101869){return function(_0x37bc5a){if(_0x37bc5a){return _0x37bc5a[_0xb962('0x21')](_0x7e6c17)['then'](function(_0x2ca1a1){return _0x2ca1a1;});}return null;};}function removeEntity(_0x152983,_0x28b33c){return function(_0x3f99de){if(_0x3f99de){return _0x3f99de[_0xb962('0x22')]()[_0xb962('0x23')](function(){_0x152983[_0xb962('0x17')](0xcc)[_0xb962('0x18')]();});}};}function handleEntityNotFound(_0x530900,_0xee399){return function(_0x5f5ab2){if(!_0x5f5ab2){_0x530900[_0xb962('0x16')](0x194);}return _0x5f5ab2;};}function handleError(_0x49a4ea,_0x5a3028){_0x5a3028=_0x5a3028||0x1f4;return function(_0x52348f){logger[_0xb962('0x24')](_0x52348f['stack']);if(_0x52348f[_0xb962('0x25')]){delete _0x52348f[_0xb962('0x25')];}_0x49a4ea['status'](_0x5a3028)['send'](_0x52348f);};}exports[_0xb962('0x26')]=function(_0x1c4423,_0x3d0b0f){var _0x5c6a06={},_0x36a949={},_0x4e6b28={'count':0x0,'rows':[]};var _0x2b7ccb=_['map'](db['CmCustomField'][_0xb962('0x27')],function(_0x3b23b4){return{'name':_0x3b23b4[_0xb962('0x28')],'type':_0x3b23b4[_0xb962('0x29')]['key']};});_0x36a949[_0xb962('0x2a')]=_[_0xb962('0x2b')](_['map'](_0x2b7ccb,_0xb962('0x25')),[_0xb962('0x25')]);_0x36a949[_0xb962('0x2c')]=_[_0xb962('0x2d')](_0x1c4423['query']);_0x36a949['filters']=_['intersection'](_0x36a949[_0xb962('0x2a')],_0x36a949[_0xb962('0x2c')]);_0x5c6a06['attributes']=_[_0xb962('0x2e')](_0x36a949[_0xb962('0x2a')],qs[_0xb962('0x2f')](_0x1c4423['query'][_0xb962('0x2f')]));_0x5c6a06[_0xb962('0x30')]=_0x5c6a06[_0xb962('0x30')][_0xb962('0x31')]?_0x5c6a06[_0xb962('0x30')]:_0x36a949[_0xb962('0x2a')];if(!_0x1c4423[_0xb962('0x2c')][_0xb962('0x32')](_0xb962('0x33'))){_0x5c6a06[_0xb962('0x1b')]=qs['limit'](_0x1c4423[_0xb962('0x2c')][_0xb962('0x1b')]);_0x5c6a06[_0xb962('0x19')]=qs['offset'](_0x1c4423[_0xb962('0x2c')][_0xb962('0x19')]);}_0x5c6a06[_0xb962('0x34')]=qs[_0xb962('0x35')](_0x1c4423[_0xb962('0x2c')][_0xb962('0x35')]);_0x5c6a06[_0xb962('0x36')]=qs[_0xb962('0x37')](_['pick'](_0x1c4423[_0xb962('0x2c')],_0x36a949[_0xb962('0x37')]),_0x2b7ccb);if(_0x1c4423['query']['filter']){_0x5c6a06[_0xb962('0x36')]=_[_0xb962('0x38')](_0x5c6a06['where'],{'$or':_[_0xb962('0x39')](_0x2b7ccb,function(_0x6cd023){if(_0x6cd023[_0xb962('0x29')]!==_0xb962('0x3a')){var _0x2aec8a={};_0x2aec8a[_0x6cd023[_0xb962('0x25')]]={'$like':'%'+_0x1c4423['query'][_0xb962('0x3b')]+'%'};return _0x2aec8a;}})});}_0x5c6a06=_[_0xb962('0x38')]({},_0x5c6a06,_0x1c4423['options']);var _0x2015c8={'where':_0x5c6a06['where']};return db[_0xb962('0x3c')]['count'](_0x2015c8)[_0xb962('0x23')](function(_0x48e0de){_0x4e6b28[_0xb962('0x1c')]=_0x48e0de;if(_0x1c4423['query'][_0xb962('0x3d')]){_0x5c6a06['include']=[{'all':!![]}];}return db['CmCustomField'][_0xb962('0x3e')](_0x5c6a06);})[_0xb962('0x23')](function(_0x4e892c){_0x4e6b28[_0xb962('0x3f')]=_0x4e892c;return _0x4e6b28;})['then'](respondWithFilteredResult(_0x3d0b0f,_0x5c6a06))[_0xb962('0x40')](handleError(_0x3d0b0f,null));};exports[_0xb962('0x41')]=function(_0x4c3d0b,_0x5bdeba){var _0x35c0f8={'raw':!![],'where':{'id':_0x4c3d0b[_0xb962('0x42')]['id']}},_0x34ed19={};_0x34ed19[_0xb962('0x2a')]=_['keys'](db[_0xb962('0x3c')][_0xb962('0x27')]);_0x34ed19[_0xb962('0x2c')]=_[_0xb962('0x2d')](_0x4c3d0b[_0xb962('0x2c')]);_0x34ed19['filters']=_[_0xb962('0x2e')](_0x34ed19[_0xb962('0x2a')],_0x34ed19[_0xb962('0x2c')]);_0x35c0f8['attributes']=_[_0xb962('0x2e')](_0x34ed19[_0xb962('0x2a')],qs[_0xb962('0x2f')](_0x4c3d0b['query'][_0xb962('0x2f')]));_0x35c0f8[_0xb962('0x30')]=_0x35c0f8['attributes'][_0xb962('0x31')]?_0x35c0f8['attributes']:_0x34ed19[_0xb962('0x2a')];if(_0x4c3d0b[_0xb962('0x2c')][_0xb962('0x3d')]){_0x35c0f8[_0xb962('0x43')]=[{'all':!![]}];}_0x35c0f8=_['merge']({},_0x35c0f8,_0x4c3d0b['options']);return db[_0xb962('0x3c')]['find'](_0x35c0f8)[_0xb962('0x23')](handleEntityNotFound(_0x5bdeba,null))['then'](respondWithResult(_0x5bdeba,null))[_0xb962('0x40')](handleError(_0x5bdeba,null));};exports[_0xb962('0x21')]=function(_0x5ba0a7,_0x513875){if(_0x5ba0a7[_0xb962('0x44')]['id']){delete _0x5ba0a7[_0xb962('0x44')]['id'];}return db[_0xb962('0x3c')][_0xb962('0x45')]({'where':{'id':_0x5ba0a7[_0xb962('0x42')]['id']}})[_0xb962('0x23')](handleEntityNotFound(_0x513875,null))['then'](saveUpdates(_0x5ba0a7[_0xb962('0x44')],null))['then'](respondWithResult(_0x513875,null))['catch'](handleError(_0x513875,null));};exports[_0xb962('0x22')]=function(_0xd90f12,_0x2b576c){return db[_0xb962('0x3c')][_0xb962('0x45')]({'where':{'id':_0xd90f12['params']['id']}})[_0xb962('0x23')](handleEntityNotFound(_0x2b576c,null))[_0xb962('0x23')](removeEntity(_0x2b576c,null))[_0xb962('0x40')](handleError(_0x2b576c,null));};exports[_0xb962('0x46')]=function(_0x624ceb,_0x2e9338){var _0x29b57d;return db['sequelize']['transaction'](function(_0x80655){return db['CmCustomField'][_0xb962('0x46')](_0x624ceb[_0xb962('0x44')],{'transaction':_0x80655})[_0xb962('0x23')](function(_0x38a4a6){_0x29b57d=_0x38a4a6;var _0x1f990e={'type':db[_0xb962('0x47')][_0xb962('0x48')],'transaction':_0x80655};switch(_0x624ceb[_0xb962('0x44')][_0xb962('0x29')]){case _0xb962('0x49'):_0x1f990e['type']=db[_0xb962('0x47')][_0xb962('0x48')];break;case _0xb962('0x4a'):_0x1f990e[_0xb962('0x29')]=db[_0xb962('0x47')][_0xb962('0x4b')];break;case _0xb962('0x4c'):_0x1f990e[_0xb962('0x29')]=db[_0xb962('0x47')][_0xb962('0x4d')];_0x1f990e[_0xb962('0x4e')]=![];break;default:}return db[_0xb962('0x4f')][_0xb962('0x50')][_0xb962('0x51')](_0xb962('0x52'),util['format'](_0xb962('0x53'),_0x29b57d['id']),_0x1f990e);})['then'](function(){return _0x29b57d;});})[_0xb962('0x23')](respondWithResult(_0x2e9338,0xc9))[_0xb962('0x40')](handleError(_0x2e9338,null));};
\ No newline at end of file