Built motion from commit ddca4d0d.|2.5.47
[motion2.git] / server / components / import / cm / csv.js
index b1ba6b8..c24327d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x10c4=['VoiceQueueId','onlyIfOpen','then','catch','query','all','VoiceQueue','outbound','BlackLists','get','always','CampaignId','generalCheckHopper','finally','contact:csv_','resume','emit','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','CmContact','parse','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','bluebird','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','Missing\x20filepath\x20parameter!','null','undefined','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','test','isNil','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','create','push','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','into','cm_hopper','fromQuery','updatedAt','select','NOW()','scheduledAt','field','toString','createdAt','from','where','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','ContactId','cm_contacts','deletedAt\x20IS\x20NULL','str','calleridnum','cm_hopper_final','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','cm_hopper_black','id\x20IN\x20?','findAll','dialCheckDuplicateType','CmList','Lists','sequelize'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x10c4,0xf3));var _0x410c=function(_0x3a6e25,_0x37fe2a){_0x3a6e25=_0x3a6e25-0x0;var _0x241ddf=_0x10c4[_0x3a6e25];return _0x241ddf;};'use strict';var BPromise=require(_0x410c('0x0'));var util=require('util');var _=require('lodash');var fs=require('fs');var squel=require('squel');var Papa=require(_0x410c('0x1'));var Redis=require(_0x410c('0x2'));var db=require(_0x410c('0x3'))['db'];var config=require(_0x410c('0x4'));var logger=require(_0x410c('0x5'))(_0x410c('0x6'));config[_0x410c('0x7')]=_[_0x410c('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x410c('0x9'))(new Redis(config[_0x410c('0x7')]));require(_0x410c('0xa'))[_0x410c('0xb')](socket);try{if(!process[_0x410c('0xc')][0x2]||process['argv'][0x2]==='undefined'||process[_0x410c('0xc')][0x2]==='null'){throw new Error(_0x410c('0xd'));}var FILEPATH=process[_0x410c('0xc')][0x2];if(!process[_0x410c('0xc')][0x3]||process[_0x410c('0xc')][0x3]==='undefined'||process[_0x410c('0xc')][0x3]===_0x410c('0xe')||!process[_0x410c('0xc')][0x4]||process[_0x410c('0xc')][0x4]===_0x410c('0xf')||process['argv'][0x4]===_0x410c('0xe')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0x410c('0x10')](process[_0x410c('0xc')][0x3][_0x410c('0x11')](','),process['argv'][0x4][_0x410c('0x11')](','));if(!process[_0x410c('0xc')][0x5]||process[_0x410c('0xc')][0x5]===_0x410c('0xf')||process[_0x410c('0xc')][0x5]===_0x410c('0xe')){throw new Error(_0x410c('0x12'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x410c('0xc')][0x6]&&process['argv'][0x6]!==_0x410c('0xf')&&process[_0x410c('0xc')][0x6]!==_0x410c('0xe')?process[_0x410c('0xc')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x410c('0xc')][0x7]!=='undefined'&&process[_0x410c('0xc')][0x7]!==_0x410c('0xe')?process[_0x410c('0xc')][0x7]:null;if(!process['argv'][0x8]||process[_0x410c('0xc')][0x8]===_0x410c('0xf')||process['argv'][0x8]===_0x410c('0xe')){throw new Error(_0x410c('0x13'));}var SOCKET_TIMESTAMP=process[_0x410c('0xc')][0x8];}catch(_0x2b8dea){logger['error'](_0x2b8dea);endCsv();}var total=0x0;var pTotal=0x0;var success=0x0;var errors=0x0;var duplicates=0x0;var rows=[];var hopperContacts='';var promises=[];var index=0x0;var alreadyInvalid=![];function handleCheckRowError(_0x1170b1,_0x545bf5,_0x221739,_0x4ff0fb){var _0x5ed540={'message':_0x545bf5};_0x5ed540[_0x1170b1]=!![];if(_0x221739){_0x5ed540['contact']=_0x221739;}if(_0x4ff0fb){_0x5ed540['index']=_0x4ff0fb;}return _0x5ed540;}function isEmail(_0x3f8e04){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0x410c('0x14')](_0x3f8e04);}function checkRow(_0x29bd13,_0x58dfe1,_0x4e28aa){return new BPromise(function(_0x15dea7,_0x3a3cb3){if(_[_0x410c('0x15')](_0x29bd13)){return _0x3a3cb3(handleCheckRowError(_0x410c('0x16'),_0x410c('0x17'),null,_0x4e28aa));}if(_0x29bd13[_0x410c('0x18')]&&_0x29bd13[_0x410c('0x18')][_0x410c('0x19')]){var _0x3851f7=_[_0x410c('0x1a')](_0x29bd13[_0x410c('0x18')],_0x410c('0x1b'))[_0x410c('0x1c')](';');return _0x3a3cb3(handleCheckRowError(_0x410c('0x16'),_0x3851f7,null,_0x4e28aa));}var _0x3d906f={};for(var _0x8bbc03 in FIELDS){if(FIELDS[_0x410c('0x1d')](_0x8bbc03)&&FIELDS[_0x8bbc03]){_0x3d906f[_0x8bbc03]=_0x29bd13[_0x410c('0x1e')][0x0][FIELDS[_0x8bbc03]]||_0x29bd13[_0x410c('0x1e')][0x0]['\ufeff'+FIELDS[_0x8bbc03]];}}if(!_0x3d906f[_0x410c('0x1f')]){return _0x3a3cb3(handleCheckRowError(_0x410c('0x16'),_0x410c('0x20'),null,_0x4e28aa));}if(!_0x3d906f[_0x410c('0x21')]){return _0x3a3cb3(handleCheckRowError(_0x410c('0x16'),_0x410c('0x22'),null,_0x4e28aa));}if(_0x3d906f[_0x410c('0x23')]){var _0x5cf709=moment(_0x3d906f[_0x410c('0x23')],_0x410c('0x24'));if(!_0x5cf709[_0x410c('0x25')]()){return _0x3a3cb3(handleCheckRowError(_0x410c('0x16'),_0x410c('0x26'),null,_0x4e28aa));}}if(_0x3d906f['email']){if(!isEmail(_0x3d906f['email'])){return _0x3a3cb3(handleCheckRowError(_0x410c('0x16'),'email\x20format\x20is\x20not\x20valid!',null,_0x4e28aa));}}_0x3d906f[_0x410c('0x27')]=LISTID;_0x3d906f[_0x410c('0x28')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x410c('0x19')]&&_0x58dfe1){var _0x190823={};for(var _0x3823ed=0x0,_0x3661bd=DUPLICATES[_0x410c('0x19')];_0x3823ed<_0x3661bd;_0x3823ed+=0x1){_0x190823[DUPLICATES[_0x3823ed]]=_0x3d906f[DUPLICATES[_0x3823ed]];}var _0xfca940=_[_0x410c('0x29')](_0x58dfe1,_0x190823);if(_0xfca940){return _0x3a3cb3(handleCheckRowError(_0x410c('0x2a'),_0x410c('0x2b'),_0xfca940,_0x4e28aa));}}return db['CmContact'][_0x410c('0x2c')](_0x3d906f,{'raw':!![],'hooks':![],'fields':_['keys'](_0x3d906f)})['then'](function(_0x355810){if(DUPLICATES&&DUPLICATES[_0x410c('0x19')]&&_0x58dfe1){_0x58dfe1[_0x410c('0x2d')](_['pick'](_0x3d906f,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x355810['id'];return _0x15dea7();})['catch'](function(_0x4e5902){return _0x3a3cb3(handleCheckRowError(_0x410c('0x16'),_0x410c('0x2e')+(_0x4e5902[_0x410c('0x1b')]||JSON[_0x410c('0x2f')](_0x4e5902)),null,_0x4e28aa));});});}function checkHopper(){function _0x48c57a(){return function(_0x841906){logger['error'](_0x410c('0x30'),_0x410c('0x31'),util[_0x410c('0x32')](_0x841906,{'showHidden':![],'depth':null}));};}var _0x5e491b=function(_0x2ad5f6,_0x570f1b){var _0x5b0da8=squel[_0x410c('0x33')]()[_0x410c('0x34')](_0x410c('0x35'))[_0x410c('0x36')]([_0x410c('0x21'),'scheduledAt','ContactId','ListId',_0x570f1b,'createdAt',_0x410c('0x37')],squel[_0x410c('0x38')]()['field'](_0x410c('0x21'),_0x410c('0x21'))['field'](_0x410c('0x39'),_0x410c('0x3a'))['field']('id','ContactId')[_0x410c('0x3b')](LISTID[_0x410c('0x3c')](),_0x410c('0x27'))[_0x410c('0x3b')](_0x2ad5f6['id'][_0x410c('0x3c')](),_0x570f1b)[_0x410c('0x3b')](_0x410c('0x39'),_0x410c('0x3d'))[_0x410c('0x3b')](_0x410c('0x39'),_0x410c('0x37'))[_0x410c('0x3e')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0x410c('0x3f')]('ListId\x20=\x20?',LISTID['toString']())[_0x410c('0x3f')]('phone\x20IS\x20NOT\x20NULL')['where'](_0x410c('0x40'),squel[_0x410c('0x38')]()[_0x410c('0x3b')](_0x410c('0x21'))[_0x410c('0x3e')](_0x410c('0x35'))['where'](_0x570f1b+_0x410c('0x41'),_0x2ad5f6['id']['toString']())))[_0x410c('0x3c')]();return _0x5b0da8;};var _0x4c57e5=function(_0x44930c,_0x122841){var _0x1a2dea=squel[_0x410c('0x33')]()['into']('cm_hopper')['fromQuery']([_0x410c('0x21'),_0x410c('0x3a'),_0x410c('0x42'),_0x410c('0x27'),_0x122841,_0x410c('0x3d'),'updatedAt'],squel[_0x410c('0x38')]()['field'](_0x410c('0x21'),_0x410c('0x21'))[_0x410c('0x3b')](_0x410c('0x39'),_0x410c('0x3a'))['field']('id','ContactId')[_0x410c('0x3b')](LISTID[_0x410c('0x3c')](),'ListId')['field'](_0x44930c['id'][_0x410c('0x3c')](),_0x122841)[_0x410c('0x3b')](_0x410c('0x39'),_0x410c('0x3d'))[_0x410c('0x3b')](_0x410c('0x39'),_0x410c('0x37'))[_0x410c('0x3e')](_0x410c('0x43'))[_0x410c('0x3f')](_0x410c('0x44'))[_0x410c('0x3f')]('ListId\x20=\x20?',LISTID[_0x410c('0x3c')]())[_0x410c('0x3f')]('id\x20IN\x20?',squel[_0x410c('0x45')](hopperContacts))[_0x410c('0x3f')]('phone\x20IS\x20NOT\x20NULL')[_0x410c('0x3f')](_0x410c('0x40'),squel[_0x410c('0x38')]()[_0x410c('0x3b')](_0x410c('0x46'))['from'](_0x410c('0x47'))['where'](_0x122841+_0x410c('0x41'),_0x44930c['id'][_0x410c('0x3c')]()))[_0x410c('0x3f')](_0x410c('0x40'),squel[_0x410c('0x38')]()[_0x410c('0x3b')](_0x410c('0x21'))[_0x410c('0x3e')](_0x410c('0x35'))[_0x410c('0x3f')](_0x122841+_0x410c('0x41'),_0x44930c['id'][_0x410c('0x3c')]())))[_0x410c('0x3c')]();return _0x1a2dea;};function _0x501271(_0x3662f0,_0x19474e){var _0x37be2b=squel[_0x410c('0x33')]()[_0x410c('0x34')]('cm_hopper')[_0x410c('0x36')]([_0x410c('0x21'),'scheduledAt',_0x410c('0x42'),_0x410c('0x27'),_0x19474e,_0x410c('0x3d'),_0x410c('0x37')],squel[_0x410c('0x38')]()[_0x410c('0x3b')](_0x410c('0x21'),_0x410c('0x21'))[_0x410c('0x3b')](_0x410c('0x39'),_0x410c('0x3a'))[_0x410c('0x3b')]('id',_0x410c('0x42'))[_0x410c('0x3b')](LISTID['toString'](),_0x410c('0x27'))[_0x410c('0x3b')](_0x3662f0['id'][_0x410c('0x3c')](),_0x19474e)[_0x410c('0x3b')](_0x410c('0x39'),_0x410c('0x3d'))[_0x410c('0x3b')]('NOW()','updatedAt')[_0x410c('0x3e')](_0x410c('0x43'))[_0x410c('0x3f')]('deletedAt\x20IS\x20NULL')[_0x410c('0x3f')](_0x410c('0x48'),LISTID[_0x410c('0x3c')]())['where']('id\x20IN\x20?',squel['str'](hopperContacts))['where'](_0x410c('0x49')))[_0x410c('0x3c')]();return _0x37be2b;}function _0x2055a7(_0x2c7b4e,_0x1c43f1){var _0x57a3b3=squel[_0x410c('0x33')]()['into'](_0x410c('0x4a'))['fromQuery']([_0x410c('0x21'),_0x410c('0x42'),_0x410c('0x27'),_0x1c43f1,_0x410c('0x3d'),_0x410c('0x37')],squel[_0x410c('0x38')]()[_0x410c('0x3b')](_0x410c('0x21'),'phone')[_0x410c('0x3b')]('id',_0x410c('0x42'))[_0x410c('0x3b')](LISTID[_0x410c('0x3c')](),_0x410c('0x27'))[_0x410c('0x3b')](_0x2c7b4e['id'][_0x410c('0x3c')](),_0x1c43f1)[_0x410c('0x3b')](_0x410c('0x39'),_0x410c('0x3d'))[_0x410c('0x3b')](_0x410c('0x39'),_0x410c('0x37'))[_0x410c('0x3e')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0x410c('0x3f')](_0x410c('0x48'),LISTID[_0x410c('0x3c')]())[_0x410c('0x3f')](_0x410c('0x4b'),squel['str'](hopperContacts))[_0x410c('0x3f')](_0x410c('0x49')))[_0x410c('0x3c')]();return _0x57a3b3;}return db['VoiceQueue'][_0x410c('0x4c')]({'where':{'type':'outbound'},'attributes':['id',_0x410c('0x4d')],'include':[{'model':db[_0x410c('0x4e')],'as':_0x410c('0x4f'),'where':{'id':LISTID}}]})['then'](function(_0x54a2e8){var _0x403cc9=[];if(_0x54a2e8){var _0x1d66e3;for(var _0x576926=0x0,_0x776135;_0x576926<_0x54a2e8['length'];_0x576926+=0x1){_0x776135=_0x54a2e8[_0x576926]['get']({'plain':!![]});switch(_0x776135[_0x410c('0x4d')]){case'always':_0x403cc9[_0x410c('0x2d')](db[_0x410c('0x50')]['query'](_0x4c57e5(_0x776135,_0x410c('0x51')))['then'](function(){})['catch'](_0x48c57a()));break;case _0x410c('0x52'):_0x403cc9[_0x410c('0x2d')](db[_0x410c('0x50')]['query'](_0x5e491b(_0x776135,'VoiceQueueId'))[_0x410c('0x53')](function(){})[_0x410c('0x54')](_0x48c57a()));break;default:_0x403cc9[_0x410c('0x2d')](db[_0x410c('0x50')][_0x410c('0x55')](_0x501271(_0x776135,_0x410c('0x51')))['then'](function(){})['catch'](_0x48c57a()));}}}return _0x403cc9;})[_0x410c('0x56')]()['then'](function(){return db[_0x410c('0x57')][_0x410c('0x4c')]({'where':{'type':_0x410c('0x58')},'attributes':['id'],'include':[{'model':db[_0x410c('0x4e')],'as':_0x410c('0x59'),'where':{'id':LISTID}}]})[_0x410c('0x53')](function(_0x169ef7){var _0x399222=[];if(_0x169ef7){var _0x2690ac;for(var _0x529179=0x0,_0x4e86df;_0x529179<_0x169ef7[_0x410c('0x19')];_0x529179+=0x1){_0x4e86df=_0x169ef7[_0x529179][_0x410c('0x5a')]({'plain':!![]});_0x399222['push'](db[_0x410c('0x50')][_0x410c('0x55')](_0x2055a7(_0x4e86df,'VoiceQueueId'))[_0x410c('0x53')](function(){})[_0x410c('0x54')](_0x48c57a()));}}return _0x399222;})[_0x410c('0x56')]();})[_0x410c('0x53')](function(){return db['Campaign'][_0x410c('0x4c')]({'attributes':['id',_0x410c('0x4d')],'include':[{'model':db[_0x410c('0x4e')],'as':_0x410c('0x4f'),'where':{'id':LISTID}}]})[_0x410c('0x53')](function(_0x48e6a8){var _0x14cf07=[];if(_0x48e6a8){for(var _0x515ea7=0x0,_0x168754;_0x515ea7<_0x48e6a8[_0x410c('0x19')];_0x515ea7+=0x1){_0x168754=_0x48e6a8[_0x515ea7][_0x410c('0x5a')]({'plain':!![]});switch(_0x168754['dialCheckDuplicateType']){case _0x410c('0x5b'):_0x14cf07['push'](db['sequelize'][_0x410c('0x55')](_0x4c57e5(_0x168754,'CampaignId'))[_0x410c('0x53')](function(){})[_0x410c('0x54')](_0x48c57a()));break;case _0x410c('0x52'):_0x14cf07[_0x410c('0x2d')](db[_0x410c('0x50')][_0x410c('0x55')](_0x5e491b(_0x168754,_0x410c('0x5c')))['then'](function(){})[_0x410c('0x54')](_0x48c57a()));break;default:_0x14cf07['push'](db[_0x410c('0x50')][_0x410c('0x55')](_0x501271(_0x168754,_0x410c('0x5c')))['then'](function(){})['catch'](_0x48c57a()));}}}return _0x14cf07;})[_0x410c('0x56')]();})[_0x410c('0x53')](function(){return db['Campaign'][_0x410c('0x4c')]({'attributes':['id'],'include':[{'model':db[_0x410c('0x4e')],'as':_0x410c('0x59'),'where':{'id':LISTID}}]})[_0x410c('0x53')](function(_0x18b42d){var _0x1205a7=[];if(_0x18b42d){for(var _0x3e85c2=0x0,_0x1d4021;_0x3e85c2<_0x18b42d[_0x410c('0x19')];_0x3e85c2+=0x1){_0x1d4021=_0x18b42d[_0x3e85c2][_0x410c('0x5a')]({'plain':!![]});_0x1205a7[_0x410c('0x2d')](db['sequelize']['query'](_0x2055a7(_0x1d4021,'CampaignId'))['then'](function(){})[_0x410c('0x54')](_0x48c57a()));}}return _0x1205a7;})['all']();})[_0x410c('0x54')](function(_0x18606c){logger[_0x410c('0x16')]('cmContact,\x20%s,\x20%s',_0x410c('0x5d'),_0x18606c['message']);});}var processPromises=function(_0x2a77da){return BPromise[_0x410c('0x56')](promises)[_0x410c('0x53')](function(_0x230c8c){})['catch'](function(_0x2e26e3){logger[_0x410c('0x16')]('Error\x20processing\x20rows\x20block:',JSON['stringify'](_0x2e26e3));})[_0x410c('0x5e')](function(){socket['emit'](_0x410c('0x5f')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x2a77da){return _0x2a77da[_0x410c('0x60')]();}});};var endCsv=function(){return BPromise['resolve']()[_0x410c('0x53')](function(){if(hopperContacts){return checkHopper();}})[_0x410c('0x53')](function(){socket[_0x410c('0x61')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x410c('0x62')](FILEPATH);}catch(_0x184b91){logger[_0x410c('0x16')](_0x410c('0x63'),JSON[_0x410c('0x2f')](_0x184b91));}finally{process[_0x410c('0x64')](0x0);}});};process['on'](_0x410c('0x65'),function(){logger[_0x410c('0x66')](_0x410c('0x67'));endCsv();});function main(){return BPromise['resolve']()[_0x410c('0x53')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0x410c('0x68')][_0x410c('0x4c')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x41b478){var _0xf67a9c=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x410c('0x69')](_0xf67a9c,{'header':!![],'skipEmptyLines':!![],'step':function(_0x3e2828,_0x562f23){total+=0x1;var _0x4f5f2c=total;promises[_0x410c('0x2d')](checkRow(_0x3e2828,_0x41b478,_0x4f5f2c)['then'](function(){success+=0x1;})['catch'](function(_0x217e08){if(_0x217e08['error']){errors+=0x1;delete _0x217e08['error'];}else if(_0x217e08['duplicate']){duplicates+=0x1;delete _0x217e08[_0x410c('0x2a')];}rows[_0x410c('0x2d')](_0x217e08);}));if(total%0xc8===0x0){_0x562f23['pause']();return processPromises(_0x562f23);}},'complete':function(){return processPromises()['then'](function(){logger[_0x410c('0x66')](_0x410c('0x6a'));endCsv();});},'error':function(_0x4e302f,_0x31277c){logger['info']('CSV\x20parse\x20error',JSON[_0x410c('0x2f')](_0x4e302f));endCsv();}});})[_0x410c('0x54')](function(_0xdb02c1){logger[_0x410c('0x16')](_0x410c('0x6b'),JSON[_0x410c('0x2f')](_0xdb02c1));});}main();
\ No newline at end of file
+var _0x28f9=['CmContact','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','into','cm_hopper','fromQuery','scheduledAt','createdAt','updatedAt','select','field','NOW()','ContactId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','insert','id\x20IN\x20?','str','calleridnum','cm_hopper_final','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','always','sequelize','query','VoiceQueueId','all','CampaignId','onlyIfOpen','Campaign','BlackLists','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resolve','unlinkSync','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','util','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','null','Missing\x20filepath\x20parameter!','undefined','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','test','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','ListId','CompanyId','find','duplicate'];(function(_0xdedbbd,_0x52b68e){var _0x53e286=function(_0x25eb1a){while(--_0x25eb1a){_0xdedbbd['push'](_0xdedbbd['shift']());}};_0x53e286(++_0x52b68e);}(_0x28f9,0x185));var _0x928f=function(_0x31da59,_0x9efbc1){_0x31da59=_0x31da59-0x0;var _0xdfe4a6=_0x28f9[_0x31da59];return _0xdfe4a6;};'use strict';var BPromise=require('bluebird');var util=require(_0x928f('0x0'));var _=require('lodash');var fs=require('fs');var squel=require(_0x928f('0x1'));var Papa=require(_0x928f('0x2'));var Redis=require(_0x928f('0x3'));var db=require(_0x928f('0x4'))['db'];var config=require(_0x928f('0x5'));var logger=require('../../../config/logger')(_0x928f('0x6'));config[_0x928f('0x7')]=_[_0x928f('0x8')](config[_0x928f('0x7')],{'host':_0x928f('0x9'),'port':0x18eb});var socket=require(_0x928f('0xa'))(new Redis(config['redis']));require(_0x928f('0xb'))[_0x928f('0xc')](socket);try{if(!process[_0x928f('0xd')][0x2]||process['argv'][0x2]==='undefined'||process[_0x928f('0xd')][0x2]===_0x928f('0xe')){throw new Error(_0x928f('0xf'));}var FILEPATH=process[_0x928f('0xd')][0x2];if(!process[_0x928f('0xd')][0x3]||process[_0x928f('0xd')][0x3]===_0x928f('0x10')||process[_0x928f('0xd')][0x3]===_0x928f('0xe')||!process[_0x928f('0xd')][0x4]||process[_0x928f('0xd')][0x4]===_0x928f('0x10')||process['argv'][0x4]===_0x928f('0xe')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0x928f('0x11')](process[_0x928f('0xd')][0x3][_0x928f('0x12')](','),process['argv'][0x4][_0x928f('0x12')](','));if(!process[_0x928f('0xd')][0x5]||process[_0x928f('0xd')][0x5]===_0x928f('0x10')||process[_0x928f('0xd')][0x5]===_0x928f('0xe')){throw new Error(_0x928f('0x13'));}var LISTID=process[_0x928f('0xd')][0x5];var COMPANYID=process[_0x928f('0xd')][0x6]&&process[_0x928f('0xd')][0x6]!==_0x928f('0x10')&&process[_0x928f('0xd')][0x6]!==_0x928f('0xe')?process[_0x928f('0xd')][0x6]:null;var DUPLICATES=process[_0x928f('0xd')][0x7]&&process['argv'][0x7]!==_0x928f('0x10')&&process['argv'][0x7]!==_0x928f('0xe')?process[_0x928f('0xd')][0x7]:null;if(!process[_0x928f('0xd')][0x8]||process[_0x928f('0xd')][0x8]===_0x928f('0x10')||process[_0x928f('0xd')][0x8]==='null'){throw new Error(_0x928f('0x14'));}var SOCKET_TIMESTAMP=process[_0x928f('0xd')][0x8];}catch(_0x18e549){logger[_0x928f('0x15')](_0x18e549);endCsv();}var total=0x0;var pTotal=0x0;var success=0x0;var errors=0x0;var duplicates=0x0;var rows=[];var hopperContacts='';var promises=[];var index=0x0;var alreadyInvalid=![];function handleCheckRowError(_0x4667d5,_0x19354d,_0xcd3b9c,_0x4e3ba2){var _0x529161={'message':_0x19354d};_0x529161[_0x4667d5]=!![];if(_0xcd3b9c){_0x529161['contact']=_0xcd3b9c;}if(_0x4e3ba2){_0x529161['index']=_0x4e3ba2;}return _0x529161;}function isEmail(_0xe43297){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0x928f('0x16')](_0xe43297);}function checkRow(_0x3a8623,_0x877bb6,_0x278edc){return new BPromise(function(_0x293b6e,_0x35b9a9){if(_['isNil'](_0x3a8623)){return _0x35b9a9(handleCheckRowError(_0x928f('0x15'),_0x928f('0x17'),null,_0x278edc));}if(_0x3a8623[_0x928f('0x18')]&&_0x3a8623['errors'][_0x928f('0x19')]){var _0x3dfb7b=_['map'](_0x3a8623[_0x928f('0x18')],_0x928f('0x1a'))[_0x928f('0x1b')](';');return _0x35b9a9(handleCheckRowError('error',_0x3dfb7b,null,_0x278edc));}var _0x567d15={};for(var _0x3bbd2a in FIELDS){if(FIELDS[_0x928f('0x1c')](_0x3bbd2a)&&FIELDS[_0x3bbd2a]){_0x567d15[_0x3bbd2a]=_0x3a8623[_0x928f('0x1d')][0x0][FIELDS[_0x3bbd2a]]||_0x3a8623[_0x928f('0x1d')][0x0]['\ufeff'+FIELDS[_0x3bbd2a]];}}if(!_0x567d15[_0x928f('0x1e')]){return _0x35b9a9(handleCheckRowError(_0x928f('0x15'),_0x928f('0x1f'),null,_0x278edc));}if(!_0x567d15[_0x928f('0x20')]){return _0x35b9a9(handleCheckRowError('error',_0x928f('0x21'),null,_0x278edc));}if(_0x567d15[_0x928f('0x22')]){var _0x4d0bc=moment(_0x567d15[_0x928f('0x22')],_0x928f('0x23'));if(!_0x4d0bc[_0x928f('0x24')]()){return _0x35b9a9(handleCheckRowError(_0x928f('0x15'),_0x928f('0x25'),null,_0x278edc));}}if(_0x567d15[_0x928f('0x26')]){if(!isEmail(_0x567d15[_0x928f('0x26')])){return _0x35b9a9(handleCheckRowError('error','email\x20format\x20is\x20not\x20valid!',null,_0x278edc));}}_0x567d15[_0x928f('0x27')]=LISTID;_0x567d15[_0x928f('0x28')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x928f('0x19')]&&_0x877bb6){var _0x4fdc9b={};for(var _0x566f0f=0x0,_0xf251fe=DUPLICATES[_0x928f('0x19')];_0x566f0f<_0xf251fe;_0x566f0f+=0x1){_0x4fdc9b[DUPLICATES[_0x566f0f]]=_0x567d15[DUPLICATES[_0x566f0f]];}var _0x519db5=_[_0x928f('0x29')](_0x877bb6,_0x4fdc9b);if(_0x519db5){return _0x35b9a9(handleCheckRowError(_0x928f('0x2a'),'Duplicate\x20Contact',_0x519db5,_0x278edc));}}return db[_0x928f('0x2b')]['create'](_0x567d15,{'raw':!![],'hooks':![],'fields':_['keys'](_0x567d15)})[_0x928f('0x2c')](function(_0x50a6bd){if(DUPLICATES&&DUPLICATES[_0x928f('0x19')]&&_0x877bb6){_0x877bb6[_0x928f('0x2d')](_[_0x928f('0x2e')](_0x567d15,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x50a6bd['id'];return _0x293b6e();})[_0x928f('0x2f')](function(_0x50503c){return _0x35b9a9(handleCheckRowError(_0x928f('0x15'),_0x928f('0x30')+(_0x50503c['message']||JSON[_0x928f('0x31')](_0x50503c)),null,_0x278edc));});});}function checkHopper(){function _0x23edd4(){return function(_0x1eb8e2){logger[_0x928f('0x15')](_0x928f('0x32'),_0x928f('0x33'),util[_0x928f('0x34')](_0x1eb8e2,{'showHidden':![],'depth':null}));};}var _0x1c42df=function(_0x1fc89f,_0x22de50){var _0x2b55e2=squel['insert']()[_0x928f('0x35')](_0x928f('0x36'))[_0x928f('0x37')](['phone',_0x928f('0x38'),'ContactId','ListId',_0x22de50,_0x928f('0x39'),_0x928f('0x3a')],squel[_0x928f('0x3b')]()[_0x928f('0x3c')](_0x928f('0x20'),_0x928f('0x20'))[_0x928f('0x3c')](_0x928f('0x3d'),_0x928f('0x38'))['field']('id',_0x928f('0x3e'))[_0x928f('0x3c')](LISTID[_0x928f('0x3f')](),'ListId')['field'](_0x1fc89f['id']['toString'](),_0x22de50)[_0x928f('0x3c')]('NOW()',_0x928f('0x39'))[_0x928f('0x3c')](_0x928f('0x3d'),_0x928f('0x3a'))[_0x928f('0x40')](_0x928f('0x41'))['where'](_0x928f('0x42'))[_0x928f('0x43')](_0x928f('0x44'),LISTID[_0x928f('0x3f')]())[_0x928f('0x43')](_0x928f('0x45'))['where'](_0x928f('0x46'),squel['select']()[_0x928f('0x3c')]('phone')[_0x928f('0x40')](_0x928f('0x36'))[_0x928f('0x43')](_0x22de50+_0x928f('0x47'),_0x1fc89f['id'][_0x928f('0x3f')]())))['toString']();return _0x2b55e2;};var _0x56ea82=function(_0x570055,_0x1929e5){var _0x29d75f=squel[_0x928f('0x48')]()[_0x928f('0x35')](_0x928f('0x36'))[_0x928f('0x37')]([_0x928f('0x20'),_0x928f('0x38'),'ContactId','ListId',_0x1929e5,_0x928f('0x39'),_0x928f('0x3a')],squel[_0x928f('0x3b')]()[_0x928f('0x3c')](_0x928f('0x20'),_0x928f('0x20'))['field'](_0x928f('0x3d'),'scheduledAt')[_0x928f('0x3c')]('id','ContactId')[_0x928f('0x3c')](LISTID['toString'](),'ListId')[_0x928f('0x3c')](_0x570055['id']['toString'](),_0x1929e5)[_0x928f('0x3c')](_0x928f('0x3d'),'createdAt')[_0x928f('0x3c')]('NOW()','updatedAt')[_0x928f('0x40')](_0x928f('0x41'))[_0x928f('0x43')]('deletedAt\x20IS\x20NULL')[_0x928f('0x43')](_0x928f('0x44'),LISTID['toString']())[_0x928f('0x43')](_0x928f('0x49'),squel[_0x928f('0x4a')](hopperContacts))[_0x928f('0x43')](_0x928f('0x45'))['where'](_0x928f('0x46'),squel[_0x928f('0x3b')]()[_0x928f('0x3c')](_0x928f('0x4b'))[_0x928f('0x40')](_0x928f('0x4c'))['where'](_0x1929e5+_0x928f('0x47'),_0x570055['id']['toString']()))[_0x928f('0x43')](_0x928f('0x46'),squel[_0x928f('0x3b')]()[_0x928f('0x3c')]('phone')[_0x928f('0x40')](_0x928f('0x36'))[_0x928f('0x43')](_0x1929e5+_0x928f('0x47'),_0x570055['id']['toString']())))[_0x928f('0x3f')]();return _0x29d75f;};function _0x47a60a(_0x3f1cb0,_0x4e1e3e){var _0x3248a8=squel[_0x928f('0x48')]()[_0x928f('0x35')]('cm_hopper')[_0x928f('0x37')]([_0x928f('0x20'),'scheduledAt',_0x928f('0x3e'),_0x928f('0x27'),_0x4e1e3e,'createdAt',_0x928f('0x3a')],squel['select']()[_0x928f('0x3c')]('phone',_0x928f('0x20'))[_0x928f('0x3c')](_0x928f('0x3d'),'scheduledAt')[_0x928f('0x3c')]('id',_0x928f('0x3e'))['field'](LISTID[_0x928f('0x3f')](),'ListId')['field'](_0x3f1cb0['id'][_0x928f('0x3f')](),_0x4e1e3e)[_0x928f('0x3c')]('NOW()',_0x928f('0x39'))[_0x928f('0x3c')](_0x928f('0x3d'),_0x928f('0x3a'))[_0x928f('0x40')](_0x928f('0x41'))['where']('deletedAt\x20IS\x20NULL')[_0x928f('0x43')](_0x928f('0x44'),LISTID[_0x928f('0x3f')]())[_0x928f('0x43')](_0x928f('0x49'),squel[_0x928f('0x4a')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0x928f('0x3f')]();return _0x3248a8;}function _0x774598(_0x523d20,_0x5ade7e){var _0x22d2f9=squel['insert']()[_0x928f('0x35')](_0x928f('0x4d'))[_0x928f('0x37')]([_0x928f('0x20'),_0x928f('0x3e'),_0x928f('0x27'),_0x5ade7e,_0x928f('0x39'),'updatedAt'],squel[_0x928f('0x3b')]()[_0x928f('0x3c')]('phone','phone')[_0x928f('0x3c')]('id',_0x928f('0x3e'))[_0x928f('0x3c')](LISTID[_0x928f('0x3f')](),'ListId')[_0x928f('0x3c')](_0x523d20['id']['toString'](),_0x5ade7e)[_0x928f('0x3c')](_0x928f('0x3d'),_0x928f('0x39'))[_0x928f('0x3c')](_0x928f('0x3d'),_0x928f('0x3a'))[_0x928f('0x40')](_0x928f('0x41'))[_0x928f('0x43')](_0x928f('0x42'))[_0x928f('0x43')](_0x928f('0x44'),LISTID[_0x928f('0x3f')]())[_0x928f('0x43')]('id\x20IN\x20?',squel[_0x928f('0x4a')](hopperContacts))[_0x928f('0x43')](_0x928f('0x45')))['toString']();return _0x22d2f9;}return db[_0x928f('0x4e')][_0x928f('0x4f')]({'where':{'type':_0x928f('0x50')},'attributes':['id',_0x928f('0x51')],'include':[{'model':db[_0x928f('0x52')],'as':_0x928f('0x53'),'where':{'id':LISTID}}]})[_0x928f('0x2c')](function(_0x51ff16){var _0x4c8508=[];if(_0x51ff16){var _0x3b2329;for(var _0x34d764=0x0,_0x1711d8;_0x34d764<_0x51ff16['length'];_0x34d764+=0x1){_0x1711d8=_0x51ff16[_0x34d764][_0x928f('0x54')]({'plain':!![]});switch(_0x1711d8[_0x928f('0x51')]){case _0x928f('0x55'):_0x4c8508[_0x928f('0x2d')](db[_0x928f('0x56')][_0x928f('0x57')](_0x56ea82(_0x1711d8,_0x928f('0x58')))[_0x928f('0x2c')](function(){})[_0x928f('0x2f')](_0x23edd4()));break;case'onlyIfOpen':_0x4c8508[_0x928f('0x2d')](db['sequelize']['query'](_0x1c42df(_0x1711d8,_0x928f('0x58')))[_0x928f('0x2c')](function(){})[_0x928f('0x2f')](_0x23edd4()));break;default:_0x4c8508[_0x928f('0x2d')](db[_0x928f('0x56')][_0x928f('0x57')](_0x47a60a(_0x1711d8,_0x928f('0x58')))[_0x928f('0x2c')](function(){})['catch'](_0x23edd4()));}}}return _0x4c8508;})[_0x928f('0x59')]()['then'](function(){return db[_0x928f('0x4e')][_0x928f('0x4f')]({'where':{'type':_0x928f('0x50')},'attributes':['id'],'include':[{'model':db[_0x928f('0x52')],'as':'BlackLists','where':{'id':LISTID}}]})['then'](function(_0x5f430d){var _0x2bd5e9=[];if(_0x5f430d){var _0x119a9c;for(var _0x2fdae2=0x0,_0xa60787;_0x2fdae2<_0x5f430d['length'];_0x2fdae2+=0x1){_0xa60787=_0x5f430d[_0x2fdae2]['get']({'plain':!![]});_0x2bd5e9[_0x928f('0x2d')](db[_0x928f('0x56')][_0x928f('0x57')](_0x774598(_0xa60787,_0x928f('0x58')))[_0x928f('0x2c')](function(){})[_0x928f('0x2f')](_0x23edd4()));}}return _0x2bd5e9;})[_0x928f('0x59')]();})[_0x928f('0x2c')](function(){return db['Campaign']['findAll']({'attributes':['id',_0x928f('0x51')],'include':[{'model':db[_0x928f('0x52')],'as':_0x928f('0x53'),'where':{'id':LISTID}}]})[_0x928f('0x2c')](function(_0x2c8e59){var _0xcaa5e4=[];if(_0x2c8e59){for(var _0x416b6d=0x0,_0x417bbb;_0x416b6d<_0x2c8e59[_0x928f('0x19')];_0x416b6d+=0x1){_0x417bbb=_0x2c8e59[_0x416b6d]['get']({'plain':!![]});switch(_0x417bbb[_0x928f('0x51')]){case _0x928f('0x55'):_0xcaa5e4[_0x928f('0x2d')](db[_0x928f('0x56')]['query'](_0x56ea82(_0x417bbb,_0x928f('0x5a')))['then'](function(){})[_0x928f('0x2f')](_0x23edd4()));break;case _0x928f('0x5b'):_0xcaa5e4[_0x928f('0x2d')](db[_0x928f('0x56')][_0x928f('0x57')](_0x1c42df(_0x417bbb,'CampaignId'))[_0x928f('0x2c')](function(){})['catch'](_0x23edd4()));break;default:_0xcaa5e4[_0x928f('0x2d')](db[_0x928f('0x56')][_0x928f('0x57')](_0x47a60a(_0x417bbb,_0x928f('0x5a')))[_0x928f('0x2c')](function(){})[_0x928f('0x2f')](_0x23edd4()));}}}return _0xcaa5e4;})[_0x928f('0x59')]();})[_0x928f('0x2c')](function(){return db[_0x928f('0x5c')][_0x928f('0x4f')]({'attributes':['id'],'include':[{'model':db[_0x928f('0x52')],'as':_0x928f('0x5d'),'where':{'id':LISTID}}]})['then'](function(_0xb25912){var _0x227237=[];if(_0xb25912){for(var _0x4ed4dc=0x0,_0x50922f;_0x4ed4dc<_0xb25912[_0x928f('0x19')];_0x4ed4dc+=0x1){_0x50922f=_0xb25912[_0x4ed4dc][_0x928f('0x54')]({'plain':!![]});_0x227237[_0x928f('0x2d')](db[_0x928f('0x56')][_0x928f('0x57')](_0x774598(_0x50922f,'CampaignId'))[_0x928f('0x2c')](function(){})[_0x928f('0x2f')](_0x23edd4()));}}return _0x227237;})['all']();})[_0x928f('0x2f')](function(_0x1eeb72){logger[_0x928f('0x15')](_0x928f('0x5e'),_0x928f('0x5f'),_0x1eeb72[_0x928f('0x1a')]);});}var processPromises=function(_0x5a10de){return BPromise[_0x928f('0x59')](promises)['then'](function(_0xfc8286){})['catch'](function(_0x2e76df){logger[_0x928f('0x15')](_0x928f('0x60'),JSON[_0x928f('0x31')](_0x2e76df));})[_0x928f('0x61')](function(){socket[_0x928f('0x62')](_0x928f('0x63')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x5a10de){return _0x5a10de['resume']();}});};var endCsv=function(){return BPromise[_0x928f('0x64')]()[_0x928f('0x2c')](function(){if(hopperContacts){return checkHopper();}})[_0x928f('0x2c')](function(){socket[_0x928f('0x62')](_0x928f('0x63')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x928f('0x65')](FILEPATH);}catch(_0x15867f){logger[_0x928f('0x15')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0x928f('0x31')](_0x15867f));}finally{process[_0x928f('0x66')](0x0);}});};process['on'](_0x928f('0x67'),function(){logger[_0x928f('0x68')](_0x928f('0x69'));endCsv();});function main(){return BPromise[_0x928f('0x64')]()[_0x928f('0x2c')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x928f('0x12')](',');return db[_0x928f('0x2b')][_0x928f('0x4f')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x928f('0x2c')](function(_0xa66fc7){var _0x1eb52a=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x1eb52a,{'header':!![],'skipEmptyLines':!![],'step':function(_0x26bfd2,_0x57915c){total+=0x1;var _0x21afb2=total;promises[_0x928f('0x2d')](checkRow(_0x26bfd2,_0xa66fc7,_0x21afb2)[_0x928f('0x2c')](function(){success+=0x1;})['catch'](function(_0x2e9cad){if(_0x2e9cad[_0x928f('0x15')]){errors+=0x1;delete _0x2e9cad[_0x928f('0x15')];}else if(_0x2e9cad[_0x928f('0x2a')]){duplicates+=0x1;delete _0x2e9cad[_0x928f('0x2a')];}rows[_0x928f('0x2d')](_0x2e9cad);}));if(total%0xc8===0x0){_0x57915c['pause']();return processPromises(_0x57915c);}},'complete':function(){return processPromises()[_0x928f('0x2c')](function(){logger['info'](_0x928f('0x6a'));endCsv();});},'error':function(_0x19ce2d,_0x50f58d){logger[_0x928f('0x68')]('CSV\x20parse\x20error',JSON[_0x928f('0x31')](_0x19ce2d));endCsv();}});})[_0x928f('0x2f')](function(_0x271a1e){logger[_0x928f('0x15')](_0x928f('0x6b'),JSON['stringify'](_0x271a1e));});}main();
\ No newline at end of file