Built motion from commit 85328c08.|2.5.50
[motion2.git] / server / api / cmCustomField / cmCustomField.controller.js
index 3a2dfae..4e94ed6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x061d=['sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','set','Content-Range','json','apply','reject','save','update','error','stack','name','send','map','CmCustomField','rawAttributes','fieldName','key','model','differenceBy','query','intersection','attributes','fields','length','hasOwnProperty','limit','sort','filters','pick','where','merge','type','VIRTUAL','filter','options','count','then','includeAll','include','findAll','rows','catch','show','params','keys','body','find','create','transaction','Sequelize','TEXT','text','number','INTEGER','BOOLEAN','defaultValue','sequelize','queryInterface','cm_contacts','format','zip-dir','request-promise','moment','bluebird','mustache','util','path'];(function(_0x540c10,_0x45ba7e){var _0x27530b=function(_0xcb202b){while(--_0xcb202b){_0x540c10['push'](_0x540c10['shift']());}};_0x27530b(++_0x45ba7e);}(_0x061d,0xad));var _0xd061=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0x061d[_0x12d033];return _0x3b4e80;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd061('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd061('0x1'));var moment=require(_0xd061('0x2'));var BPromise=require(_0xd061('0x3'));var Mustache=require(_0xd061('0x4'));var util=require(_0xd061('0x5'));var path=require(_0xd061('0x6'));var sox=require(_0xd061('0x7'));var csv=require('to-csv');var ejs=require(_0xd061('0x8'));var fs=require('fs');var fs_extra=require(_0xd061('0x9'));var _=require(_0xd061('0xa'));var squel=require(_0xd061('0xb'));var crypto=require(_0xd061('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd061('0xd'));var toCsv=require(_0xd061('0xe'));var querystring=require(_0xd061('0xf'));var Papa=require(_0xd061('0x10'));var Redis=require(_0xd061('0x11'));var authService=require(_0xd061('0x12'));var qs=require(_0xd061('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd061('0x14'));var logger=require(_0xd061('0x15'))(_0xd061('0x16'));var utils=require(_0xd061('0x17'));var config=require(_0xd061('0x18'));var licenseUtil=require(_0xd061('0x19'));var db=require(_0xd061('0x1a'))['db'];function respondWithStatusCode(_0x50364a,_0x5e0635){_0x5e0635=_0x5e0635||0xcc;return function(_0x37fc0f){if(_0x37fc0f){return _0x50364a[_0xd061('0x1b')](_0x5e0635);}return _0x50364a[_0xd061('0x1c')](_0x5e0635)[_0xd061('0x1d')]();};}function respondWithResult(_0x6945df,_0x3a8d76){_0x3a8d76=_0x3a8d76||0xc8;return function(_0x2e95a5){if(_0x2e95a5){return _0x6945df['status'](_0x3a8d76)['json'](_0x2e95a5);}};}function respondWithFilteredResult(_0x3d94c1,_0x2b9e6b){return function(_0x29658e){if(_0x29658e){var _0x136b83=_0x29658e['count'],_0x46889c=_0x2b9e6b[_0xd061('0x1e')],_0x29e74f=_0x2b9e6b[_0xd061('0x1e')]+_0x2b9e6b['limit'],_0x40d2ce;if(_0x29e74f>=_0x136b83){_0x29e74f=_0x136b83;_0x40d2ce=0xc8;}else{_0x40d2ce=0xce;}_0x3d94c1[_0xd061('0x1c')](_0x40d2ce);return _0x3d94c1[_0xd061('0x1f')](_0xd061('0x20'),_0x46889c+'-'+_0x29e74f+'/'+_0x136b83)[_0xd061('0x21')](_0x29658e);}return null;};}function patchUpdates(_0x573e2a){return function(_0x59f7b1){try{jsonpatch[_0xd061('0x22')](_0x59f7b1,_0x573e2a,!![]);}catch(_0x12fc25){return BPromise[_0xd061('0x23')](_0x12fc25);}return _0x59f7b1[_0xd061('0x24')]();};}function saveUpdates(_0x4860bf,_0x4437c5){return function(_0x5b1cf2){if(_0x5b1cf2){return _0x5b1cf2[_0xd061('0x25')](_0x4860bf)['then'](function(_0x13a9b5){return _0x13a9b5;});}return null;};}function removeEntity(_0x3905d9,_0x513942){return function(_0x5574a1){if(_0x5574a1){return _0x5574a1['destroy']()['then'](function(){_0x3905d9['status'](0xcc)[_0xd061('0x1d')]();});}};}function handleEntityNotFound(_0x1d87d2,_0x58ffb2){return function(_0x2933ae){if(!_0x2933ae){_0x1d87d2[_0xd061('0x1b')](0x194);}return _0x2933ae;};}function handleError(_0x3dee0b,_0x2a8884){_0x2a8884=_0x2a8884||0x1f4;return function(_0x422012){logger[_0xd061('0x26')](_0x422012[_0xd061('0x27')]);if(_0x422012[_0xd061('0x28')]){delete _0x422012['name'];}_0x3dee0b[_0xd061('0x1c')](_0x2a8884)[_0xd061('0x29')](_0x422012);};}exports['index']=function(_0x552900,_0x53d132){var _0x2d2c1a={},_0x10cfac={},_0x56b1f6={'count':0x0,'rows':[]};var _0x31719e=_[_0xd061('0x2a')](db[_0xd061('0x2b')][_0xd061('0x2c')],function(_0x5eb712){return{'name':_0x5eb712[_0xd061('0x2d')],'type':_0x5eb712['type'][_0xd061('0x2e')]};});_0x10cfac[_0xd061('0x2f')]=_[_0xd061('0x30')](_[_0xd061('0x2a')](_0x31719e,'name'),['name']);_0x10cfac[_0xd061('0x31')]=_['keys'](_0x552900[_0xd061('0x31')]);_0x10cfac['filters']=_[_0xd061('0x32')](_0x10cfac[_0xd061('0x2f')],_0x10cfac['query']);_0x2d2c1a[_0xd061('0x33')]=_[_0xd061('0x32')](_0x10cfac[_0xd061('0x2f')],qs[_0xd061('0x34')](_0x552900[_0xd061('0x31')][_0xd061('0x34')]));_0x2d2c1a[_0xd061('0x33')]=_0x2d2c1a[_0xd061('0x33')][_0xd061('0x35')]?_0x2d2c1a[_0xd061('0x33')]:_0x10cfac[_0xd061('0x2f')];if(!_0x552900[_0xd061('0x31')][_0xd061('0x36')]('nolimit')){_0x2d2c1a[_0xd061('0x37')]=qs[_0xd061('0x37')](_0x552900[_0xd061('0x31')][_0xd061('0x37')]);_0x2d2c1a['offset']=qs['offset'](_0x552900['query'][_0xd061('0x1e')]);}_0x2d2c1a['order']=qs[_0xd061('0x38')](_0x552900[_0xd061('0x31')][_0xd061('0x38')]);_0x2d2c1a['where']=qs[_0xd061('0x39')](_[_0xd061('0x3a')](_0x552900[_0xd061('0x31')],_0x10cfac[_0xd061('0x39')]),_0x31719e);if(_0x552900['query']['filter']){_0x2d2c1a[_0xd061('0x3b')]=_[_0xd061('0x3c')](_0x2d2c1a['where'],{'$or':_[_0xd061('0x2a')](_0x31719e,function(_0x37f637){if(_0x37f637[_0xd061('0x3d')]!==_0xd061('0x3e')){var _0x4fbf2d={};_0x4fbf2d[_0x37f637['name']]={'$like':'%'+_0x552900[_0xd061('0x31')][_0xd061('0x3f')]+'%'};return _0x4fbf2d;}})});}_0x2d2c1a=_['merge']({},_0x2d2c1a,_0x552900[_0xd061('0x40')]);var _0x2955ac={'where':_0x2d2c1a[_0xd061('0x3b')]};return db[_0xd061('0x2b')][_0xd061('0x41')](_0x2955ac)[_0xd061('0x42')](function(_0x4ea6b0){_0x56b1f6['count']=_0x4ea6b0;if(_0x552900[_0xd061('0x31')][_0xd061('0x43')]){_0x2d2c1a[_0xd061('0x44')]=[{'all':!![]}];}return db[_0xd061('0x2b')][_0xd061('0x45')](_0x2d2c1a);})[_0xd061('0x42')](function(_0x4e49c4){_0x56b1f6[_0xd061('0x46')]=_0x4e49c4;return _0x56b1f6;})[_0xd061('0x42')](respondWithFilteredResult(_0x53d132,_0x2d2c1a))[_0xd061('0x47')](handleError(_0x53d132,null));};exports[_0xd061('0x48')]=function(_0x355561,_0x1e1967){var _0x44819c={'raw':!![],'where':{'id':_0x355561[_0xd061('0x49')]['id']}},_0x571267={};_0x571267[_0xd061('0x2f')]=_[_0xd061('0x4a')](db[_0xd061('0x2b')][_0xd061('0x2c')]);_0x571267['query']=_[_0xd061('0x4a')](_0x355561[_0xd061('0x31')]);_0x571267['filters']=_[_0xd061('0x32')](_0x571267[_0xd061('0x2f')],_0x571267['query']);_0x44819c[_0xd061('0x33')]=_[_0xd061('0x32')](_0x571267[_0xd061('0x2f')],qs[_0xd061('0x34')](_0x355561[_0xd061('0x31')][_0xd061('0x34')]));_0x44819c[_0xd061('0x33')]=_0x44819c['attributes']['length']?_0x44819c[_0xd061('0x33')]:_0x571267[_0xd061('0x2f')];if(_0x355561[_0xd061('0x31')][_0xd061('0x43')]){_0x44819c[_0xd061('0x44')]=[{'all':!![]}];}_0x44819c=_[_0xd061('0x3c')]({},_0x44819c,_0x355561[_0xd061('0x40')]);return db['CmCustomField']['find'](_0x44819c)['then'](handleEntityNotFound(_0x1e1967,null))[_0xd061('0x42')](respondWithResult(_0x1e1967,null))[_0xd061('0x47')](handleError(_0x1e1967,null));};exports[_0xd061('0x25')]=function(_0x5974e6,_0x31f59e){if(_0x5974e6[_0xd061('0x4b')]['id']){delete _0x5974e6[_0xd061('0x4b')]['id'];}return db['CmCustomField'][_0xd061('0x4c')]({'where':{'id':_0x5974e6[_0xd061('0x49')]['id']}})[_0xd061('0x42')](handleEntityNotFound(_0x31f59e,null))[_0xd061('0x42')](saveUpdates(_0x5974e6[_0xd061('0x4b')],null))[_0xd061('0x42')](respondWithResult(_0x31f59e,null))[_0xd061('0x47')](handleError(_0x31f59e,null));};exports['destroy']=function(_0xbdcfd1,_0x41ea5f){return db[_0xd061('0x2b')][_0xd061('0x4c')]({'where':{'id':_0xbdcfd1[_0xd061('0x49')]['id']}})[_0xd061('0x42')](handleEntityNotFound(_0x41ea5f,null))[_0xd061('0x42')](removeEntity(_0x41ea5f,null))[_0xd061('0x47')](handleError(_0x41ea5f,null));};exports[_0xd061('0x4d')]=function(_0x229146,_0x807a17){var _0x2197ea;return db['sequelize'][_0xd061('0x4e')](function(_0x2a6d8e){return db[_0xd061('0x2b')][_0xd061('0x4d')](_0x229146[_0xd061('0x4b')],{'transaction':_0x2a6d8e})[_0xd061('0x42')](function(_0x10b22e){_0x2197ea=_0x10b22e;var _0x350d92={'type':db[_0xd061('0x4f')][_0xd061('0x50')],'transaction':_0x2a6d8e};switch(_0x229146[_0xd061('0x4b')]['type']){case _0xd061('0x51'):_0x350d92[_0xd061('0x3d')]=db['Sequelize'][_0xd061('0x50')];break;case _0xd061('0x52'):_0x350d92['type']=db[_0xd061('0x4f')][_0xd061('0x53')];break;case'switch':_0x350d92[_0xd061('0x3d')]=db[_0xd061('0x4f')][_0xd061('0x54')];_0x350d92[_0xd061('0x55')]=![];break;default:}return db[_0xd061('0x56')][_0xd061('0x57')]['addColumn'](_0xd061('0x58'),util[_0xd061('0x59')]('cf_%d',_0x2197ea['id']),_0x350d92);})[_0xd061('0x42')](function(){return _0x2197ea;});})[_0xd061('0x42')](respondWithResult(_0x807a17,0xc9))[_0xd061('0x47')](handleError(_0x807a17,null));};
\ No newline at end of file
+var _0xe1e5=['find','body','sequelize','create','Sequelize','TEXT','text','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','format','cf_%d','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','undefined','limit','offset','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','CmCustomField','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','params','include'];(function(_0x13f6bb,_0x1d625f){var _0x413673=function(_0x6dacf6){while(--_0x6dacf6){_0x13f6bb['push'](_0x13f6bb['shift']());}};_0x413673(++_0x1d625f);}(_0xe1e5,0x16f));var _0x5e1e=function(_0x4ce15c,_0x1bbcbd){_0x4ce15c=_0x4ce15c-0x0;var _0x5ee259=_0xe1e5[_0x4ce15c];return _0x5ee259;};'use strict';var emlformat=require(_0x5e1e('0x0'));var rimraf=require(_0x5e1e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5e1e('0x2'));var rp=require('request-promise');var moment=require(_0x5e1e('0x3'));var BPromise=require(_0x5e1e('0x4'));var Mustache=require(_0x5e1e('0x5'));var util=require(_0x5e1e('0x6'));var path=require(_0x5e1e('0x7'));var sox=require(_0x5e1e('0x8'));var csv=require(_0x5e1e('0x9'));var ejs=require(_0x5e1e('0xa'));var fs=require('fs');var fs_extra=require(_0x5e1e('0xb'));var _=require(_0x5e1e('0xc'));var squel=require(_0x5e1e('0xd'));var crypto=require(_0x5e1e('0xe'));var jsforce=require(_0x5e1e('0xf'));var deskjs=require(_0x5e1e('0x10'));var toCsv=require(_0x5e1e('0x9'));var querystring=require(_0x5e1e('0x11'));var Papa=require(_0x5e1e('0x12'));var Redis=require('ioredis');var authService=require(_0x5e1e('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x5e1e('0x14'));var hardwareService=require(_0x5e1e('0x15'));var logger=require(_0x5e1e('0x16'))(_0x5e1e('0x17'));var utils=require(_0x5e1e('0x18'));var config=require(_0x5e1e('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1cf565,_0x42f996){_0x42f996=_0x42f996||0xcc;return function(_0x1f97d3){if(_0x1f97d3){return _0x1cf565['sendStatus'](_0x42f996);}return _0x1cf565[_0x5e1e('0x1a')](_0x42f996)[_0x5e1e('0x1b')]();};}function respondWithResult(_0x5c7ad8,_0x457693){_0x457693=_0x457693||0xc8;return function(_0x6976a1){if(_0x6976a1){return _0x5c7ad8[_0x5e1e('0x1a')](_0x457693)[_0x5e1e('0x1c')](_0x6976a1);}};}function respondWithFilteredResult(_0x7b7539,_0x4f2478){return function(_0x3277e9){if(_0x3277e9){var _0x4062ff=typeof _0x4f2478['offset']===_0x5e1e('0x1d')&&typeof _0x4f2478[_0x5e1e('0x1e')]===_0x5e1e('0x1d');var _0x207f1c=_0x3277e9['count'];var _0x9e596=_0x4062ff?0x0:_0x4f2478[_0x5e1e('0x1f')];var _0x4502ab=_0x4062ff?_0x3277e9['count']:_0x4f2478[_0x5e1e('0x1f')]+_0x4f2478[_0x5e1e('0x1e')];var _0x453256;if(_0x4502ab>=_0x207f1c){_0x4502ab=_0x207f1c;_0x453256=0xc8;}else{_0x453256=0xce;}_0x7b7539[_0x5e1e('0x1a')](_0x453256);return _0x7b7539['set']('Content-Range',_0x9e596+'-'+_0x4502ab+'/'+_0x207f1c)['json'](_0x3277e9);}return null;};}function patchUpdates(_0x17bd06){return function(_0x1fa80f){try{jsonpatch[_0x5e1e('0x20')](_0x1fa80f,_0x17bd06,!![]);}catch(_0x176cbd){return BPromise[_0x5e1e('0x21')](_0x176cbd);}return _0x1fa80f[_0x5e1e('0x22')]();};}function saveUpdates(_0x423c19,_0xffc52b){return function(_0x2def90){if(_0x2def90){return _0x2def90[_0x5e1e('0x23')](_0x423c19)[_0x5e1e('0x24')](function(_0x4bbe13){return _0x4bbe13;});}return null;};}function removeEntity(_0x5cdc07,_0x1b330d){return function(_0x1d49c1){if(_0x1d49c1){return _0x1d49c1[_0x5e1e('0x25')]()[_0x5e1e('0x24')](function(){_0x5cdc07[_0x5e1e('0x1a')](0xcc)[_0x5e1e('0x1b')]();});}};}function handleEntityNotFound(_0x404b84,_0x5b44f3){return function(_0x2d7f6d){if(!_0x2d7f6d){_0x404b84[_0x5e1e('0x26')](0x194);}return _0x2d7f6d;};}function handleError(_0x410d9c,_0x5cc69b){_0x5cc69b=_0x5cc69b||0x1f4;return function(_0x37d186){logger[_0x5e1e('0x27')](_0x37d186[_0x5e1e('0x28')]);if(_0x37d186[_0x5e1e('0x29')]){delete _0x37d186[_0x5e1e('0x29')];}_0x410d9c[_0x5e1e('0x1a')](_0x5cc69b)[_0x5e1e('0x2a')](_0x37d186);};}exports[_0x5e1e('0x2b')]=function(_0x45a96a,_0x5ee658){var _0xc6dd66={},_0x25259e={},_0x1ce4c9={'count':0x0,'rows':[]};var _0x42c960=_[_0x5e1e('0x2c')](db[_0x5e1e('0x2d')][_0x5e1e('0x2e')],function(_0x55d133){return{'name':_0x55d133['fieldName'],'type':_0x55d133[_0x5e1e('0x2f')]['key']};});_0x25259e['model']=_['differenceBy'](_[_0x5e1e('0x2c')](_0x42c960,_0x5e1e('0x29')),[_0x5e1e('0x29')]);_0x25259e[_0x5e1e('0x30')]=_[_0x5e1e('0x31')](_0x45a96a['query']);_0x25259e[_0x5e1e('0x32')]=_[_0x5e1e('0x33')](_0x25259e[_0x5e1e('0x34')],_0x25259e[_0x5e1e('0x30')]);_0xc6dd66[_0x5e1e('0x35')]=_[_0x5e1e('0x33')](_0x25259e[_0x5e1e('0x34')],qs[_0x5e1e('0x36')](_0x45a96a['query']['fields']));_0xc6dd66[_0x5e1e('0x35')]=_0xc6dd66['attributes'][_0x5e1e('0x37')]?_0xc6dd66[_0x5e1e('0x35')]:_0x25259e[_0x5e1e('0x34')];if(!_0x45a96a[_0x5e1e('0x30')]['hasOwnProperty'](_0x5e1e('0x38'))){_0xc6dd66['limit']=qs[_0x5e1e('0x1e')](_0x45a96a['query'][_0x5e1e('0x1e')]);_0xc6dd66[_0x5e1e('0x1f')]=qs['offset'](_0x45a96a[_0x5e1e('0x30')][_0x5e1e('0x1f')]);}_0xc6dd66[_0x5e1e('0x39')]=qs[_0x5e1e('0x3a')](_0x45a96a['query'][_0x5e1e('0x3a')]);_0xc6dd66[_0x5e1e('0x3b')]=qs[_0x5e1e('0x32')](_[_0x5e1e('0x3c')](_0x45a96a[_0x5e1e('0x30')],_0x25259e[_0x5e1e('0x32')]),_0x42c960);if(_0x45a96a[_0x5e1e('0x30')][_0x5e1e('0x3d')]){_0xc6dd66['where']=_[_0x5e1e('0x3e')](_0xc6dd66[_0x5e1e('0x3b')],{'$or':_[_0x5e1e('0x2c')](_0x42c960,function(_0x15554d){if(_0x15554d[_0x5e1e('0x2f')]!==_0x5e1e('0x3f')){var _0x484db3={};_0x484db3[_0x15554d[_0x5e1e('0x29')]]={'$like':'%'+_0x45a96a[_0x5e1e('0x30')][_0x5e1e('0x3d')]+'%'};return _0x484db3;}})});}_0xc6dd66=_[_0x5e1e('0x3e')]({},_0xc6dd66,_0x45a96a[_0x5e1e('0x40')]);var _0xfa8b63={'where':_0xc6dd66[_0x5e1e('0x3b')]};return db['CmCustomField'][_0x5e1e('0x41')](_0xfa8b63)['then'](function(_0x33ec30){_0x1ce4c9['count']=_0x33ec30;if(_0x45a96a[_0x5e1e('0x30')][_0x5e1e('0x42')]){_0xc6dd66['include']=[{'all':!![]}];}return db[_0x5e1e('0x2d')][_0x5e1e('0x43')](_0xc6dd66);})[_0x5e1e('0x24')](function(_0x16860d){_0x1ce4c9[_0x5e1e('0x44')]=_0x16860d;return _0x1ce4c9;})[_0x5e1e('0x24')](respondWithFilteredResult(_0x5ee658,_0xc6dd66))[_0x5e1e('0x45')](handleError(_0x5ee658,null));};exports[_0x5e1e('0x46')]=function(_0x10e2c8,_0x107285){var _0x15d453={'raw':!![],'where':{'id':_0x10e2c8[_0x5e1e('0x47')]['id']}},_0x400084={};_0x400084[_0x5e1e('0x34')]=_[_0x5e1e('0x31')](db[_0x5e1e('0x2d')]['rawAttributes']);_0x400084[_0x5e1e('0x30')]=_['keys'](_0x10e2c8[_0x5e1e('0x30')]);_0x400084[_0x5e1e('0x32')]=_[_0x5e1e('0x33')](_0x400084['model'],_0x400084[_0x5e1e('0x30')]);_0x15d453['attributes']=_[_0x5e1e('0x33')](_0x400084[_0x5e1e('0x34')],qs[_0x5e1e('0x36')](_0x10e2c8['query'][_0x5e1e('0x36')]));_0x15d453['attributes']=_0x15d453[_0x5e1e('0x35')]['length']?_0x15d453[_0x5e1e('0x35')]:_0x400084['model'];if(_0x10e2c8['query'][_0x5e1e('0x42')]){_0x15d453[_0x5e1e('0x48')]=[{'all':!![]}];}_0x15d453=_[_0x5e1e('0x3e')]({},_0x15d453,_0x10e2c8[_0x5e1e('0x40')]);return db[_0x5e1e('0x2d')][_0x5e1e('0x49')](_0x15d453)[_0x5e1e('0x24')](handleEntityNotFound(_0x107285,null))['then'](respondWithResult(_0x107285,null))[_0x5e1e('0x45')](handleError(_0x107285,null));};exports['update']=function(_0x478750,_0x250b54){if(_0x478750[_0x5e1e('0x4a')]['id']){delete _0x478750[_0x5e1e('0x4a')]['id'];}return db['CmCustomField'][_0x5e1e('0x49')]({'where':{'id':_0x478750[_0x5e1e('0x47')]['id']}})['then'](handleEntityNotFound(_0x250b54,null))[_0x5e1e('0x24')](saveUpdates(_0x478750[_0x5e1e('0x4a')],null))[_0x5e1e('0x24')](respondWithResult(_0x250b54,null))[_0x5e1e('0x45')](handleError(_0x250b54,null));};exports['destroy']=function(_0x335901,_0x3df82f){return db[_0x5e1e('0x2d')][_0x5e1e('0x49')]({'where':{'id':_0x335901[_0x5e1e('0x47')]['id']}})[_0x5e1e('0x24')](handleEntityNotFound(_0x3df82f,null))[_0x5e1e('0x24')](removeEntity(_0x3df82f,null))[_0x5e1e('0x45')](handleError(_0x3df82f,null));};exports['create']=function(_0x1dff92,_0x4f515e){var _0x3f40ad;return db[_0x5e1e('0x4b')]['transaction'](function(_0x33914b){return db[_0x5e1e('0x2d')][_0x5e1e('0x4c')](_0x1dff92[_0x5e1e('0x4a')],{'transaction':_0x33914b})['then'](function(_0x5b067d){_0x3f40ad=_0x5b067d;var _0x3c6e18={'type':db[_0x5e1e('0x4d')][_0x5e1e('0x4e')],'transaction':_0x33914b};switch(_0x1dff92[_0x5e1e('0x4a')]['type']){case _0x5e1e('0x4f'):_0x3c6e18[_0x5e1e('0x2f')]=db[_0x5e1e('0x4d')][_0x5e1e('0x4e')];break;case'number':_0x3c6e18[_0x5e1e('0x2f')]=db[_0x5e1e('0x4d')][_0x5e1e('0x50')];break;case _0x5e1e('0x51'):_0x3c6e18[_0x5e1e('0x2f')]=db[_0x5e1e('0x4d')][_0x5e1e('0x52')];_0x3c6e18[_0x5e1e('0x53')]=![];break;default:}return db[_0x5e1e('0x4b')][_0x5e1e('0x54')][_0x5e1e('0x55')]('cm_contacts',util[_0x5e1e('0x56')](_0x5e1e('0x57'),_0x3f40ad['id']),_0x3c6e18);})['then'](function(){return _0x3f40ad;});})[_0x5e1e('0x24')](respondWithResult(_0x4f515e,0xc9))['catch'](handleError(_0x4f515e,null));};
\ No newline at end of file