1 // *************************************************************************
3 // * xCALLY Motion - The Omnichannel Contact Center *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved *
6 // *************************************************************************
8 // * Email: info@xcally.com *
9 // * Website: https://www.xcally.com *
11 // *************************************************************************
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
17 // *************************************************************************
18 var _0xc745=['CmContact','destroy','then','bulkCreate','contacts1','CmHopper','log','finished\x20populating','hopper2','util','../mysqldb','push','Biondo','@xcally.com','now','innocenzo.biondo'];(function(_0x26d6ff,_0x36a8ef){var _0x64c785=function(_0x31cc84){while(--_0x31cc84){_0x26d6ff['push'](_0x26d6ff['shift']());}};_0x64c785(++_0x36a8ef);}(_0xc745,0x1e9));var _0x5c74=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xc745[_0x57b54c];return _0x59cc19;};'use strict';var util=require(_0x5c74('0x0'));var db=require(_0x5c74('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x5c74('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x5c74('0x3')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x5c74('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x5c74('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x5c74('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x5c74('0x5')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x5c74('0x3')+i,'phone':0xf879fb460+i,'email':_0x5c74('0x6')+i+_0x5c74('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x5c74('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x5c74('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x5c74('0x5')](),'updatedAt':Date[_0x5c74('0x5')]()});}db[_0x5c74('0x7')][_0x5c74('0x8')]({'where':{}})[_0x5c74('0x9')](function(){return db[_0x5c74('0x7')][_0x5c74('0xa')](contacts);})['then'](function(){console['log']('finished\x20populating',_0x5c74('0xb'));return db[_0x5c74('0xc')]['destroy']({'where':{}});})[_0x5c74('0x9')](function(){return db[_0x5c74('0xc')][_0x5c74('0xa')](hopper);})[_0x5c74('0x9')](function(){console[_0x5c74('0xd')]('finished\x20populating','hopper1');return db[_0x5c74('0x7')][_0x5c74('0xa')](contacts2);})['then'](function(){console['log'](_0x5c74('0xe'),'contacts2');return db[_0x5c74('0xc')]['bulkCreate'](hopper2);})[_0x5c74('0x9')](function(){console[_0x5c74('0xd')](_0x5c74('0xe'),_0x5c74('0xf'));})['catch'](function(_0x26ae73){console['log'](_0x26ae73);});