Built motion from commit da24aabd.|2.6.20
[motion2.git] / server / api / mailInteraction / mailInteraction.model.js
index b316d39..e42b399 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b07=['lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./mailInteraction.attributes','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closedAt','changed','models','closed','MailMessage','update','then','catch','utf8mb4_unicode_ci'];(function(_0x21a2b3,_0x5d6564){var _0x4651a7=function(_0x285f59){while(--_0x285f59){_0x21a2b3['push'](_0x21a2b3['shift']());}};_0x4651a7(++_0x5d6564);}(_0x9b07,0x15f));var _0x79b0=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x9b07[_0x4fde08];return _0x12e725;};'use strict';var _=require(_0x79b0('0x0'));var util=require(_0x79b0('0x1'));var logger=require(_0x79b0('0x2'))(_0x79b0('0x3'));var moment=require(_0x79b0('0x4'));var BPromise=require(_0x79b0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x79b0('0x6'));var rimraf=require('rimraf');var config=require(_0x79b0('0x7'));var attributes=require(_0x79b0('0x8'));module['exports']=function(_0x2284ab,_0x53e5a4){return _0x2284ab['define'](_0x79b0('0x9'),attributes,{'tableName':_0x79b0('0xa'),'paranoid':![],'indexes':[{'name':_0x79b0('0xb'),'fields':[_0x79b0('0xc'),'to'],'type':_0x79b0('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x647baf,_0x2b14dc,_0x2fe5ad){if(_0x647baf[_0x79b0('0xe')]){_0x647baf[_0x79b0('0xf')]=moment()[_0x79b0('0x10')](_0x79b0('0x11'));}if(_0x647baf['closed']){_0x647baf[_0x79b0('0x12')]=moment()['format'](_0x79b0('0x11'));}_0x2fe5ad(null,_0x2b14dc);},'beforeUpdate':function(_0x531a75,_0x4d28d7,_0x37bb8f){if(_0x531a75[_0x79b0('0x13')](_0x79b0('0xe'))){_0x531a75['substatusAt']=_0x531a75[_0x79b0('0xe')]?moment()[_0x79b0('0x10')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x531a75[_0x79b0('0x13')]('closed')){_0x531a75[_0x79b0('0x12')]=moment()[_0x79b0('0x10')](_0x79b0('0x11'));_0x531a75[_0x79b0('0xe')]=null;_0x531a75[_0x79b0('0xf')]=null;}_0x37bb8f(null,_0x531a75);},'afterUpdate':function(_0x1d5718,_0x25169e,_0x10cf25){var _0x544ea0=_0x2284ab[_0x79b0('0x14')];var _0x2cb9f1=_0x1d5718['get']({'plain':!![]});if(_0x2cb9f1[_0x79b0('0x15')]){return _0x544ea0[_0x79b0('0x16')][_0x79b0('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x2cb9f1['id']}})[_0x79b0('0x18')](function(){_0x10cf25();})[_0x79b0('0x19')](function(_0x54b5d1){_0x10cf25(_0x54b5d1);});}else{_0x10cf25();}}},'charset':'utf8mb4','collate':_0x79b0('0x1a')});};
\ No newline at end of file
+var _0x519e=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./mailInteraction.attributes','exports','define','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','MailMessage','update','then','catch','utf8mb4'];(function(_0x3b3cce,_0xdae6f){var _0xaa76b0=function(_0x5af0d9){while(--_0x5af0d9){_0x3b3cce['push'](_0x3b3cce['shift']());}};_0xaa76b0(++_0xdae6f);}(_0x519e,0x135));var _0xe519=function(_0x37631d,_0x2618eb){_0x37631d=_0x37631d-0x0;var _0x2f6d77=_0x519e[_0x37631d];return _0x2f6d77;};'use strict';var _=require(_0xe519('0x0'));var util=require(_0xe519('0x1'));var logger=require(_0xe519('0x2'))(_0xe519('0x3'));var moment=require('moment');var BPromise=require(_0xe519('0x4'));var rp=require(_0xe519('0x5'));var fs=require('fs');var path=require(_0xe519('0x6'));var rimraf=require(_0xe519('0x7'));var config=require('../../config/environment');var attributes=require(_0xe519('0x8'));module[_0xe519('0x9')]=function(_0x5b116f,_0x43a06f){return _0x5b116f[_0xe519('0xa')]('MailInteraction',attributes,{'tableName':_0xe519('0xb'),'paranoid':![],'indexes':[{'name':_0xe519('0xc'),'fields':[_0xe519('0xd'),'to'],'type':_0xe519('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0xeab435,_0x3c5d21,_0x5a5177){if(_0xeab435[_0xe519('0xf')]){_0xeab435[_0xe519('0x10')]=moment()[_0xe519('0x11')](_0xe519('0x12'));}if(_0xeab435[_0xe519('0x13')]){_0xeab435[_0xe519('0x14')]=moment()[_0xe519('0x11')](_0xe519('0x12'));}_0x5a5177(null,_0x3c5d21);},'beforeUpdate':function(_0x52d72c,_0x199ed3,_0x33bd93){if(_0x52d72c[_0xe519('0x15')](_0xe519('0xf'))){_0x52d72c[_0xe519('0x10')]=_0x52d72c[_0xe519('0xf')]?moment()[_0xe519('0x11')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x52d72c[_0xe519('0x15')](_0xe519('0x13'))){_0x52d72c['closedAt']=moment()['format'](_0xe519('0x12'));_0x52d72c[_0xe519('0xf')]=null;_0x52d72c[_0xe519('0x10')]=null;}_0x33bd93(null,_0x52d72c);},'afterUpdate':function(_0x398661,_0x243316,_0x564bb8){var _0x33215f=_0x5b116f['models'];var _0x59ae37=_0x398661['get']({'plain':!![]});if(_0x59ae37[_0xe519('0x13')]){return _0x33215f[_0xe519('0x16')][_0xe519('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x59ae37['id']}})[_0xe519('0x18')](function(){_0x564bb8();})[_0xe519('0x19')](function(_0x535c78){_0x564bb8(_0x535c78);});}else{_0x564bb8();}}},'charset':_0xe519('0x1a'),'collate':_0xe519('0x1b')});};
\ No newline at end of file