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 _0xa914=['contacts1','contacts2','catch','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','destroy','then','bulkCreate','log','finished\x20populating'];(function(_0x513483,_0x105ccd){var _0x384a1e=function(_0x47bb41){while(--_0x47bb41){_0x513483['push'](_0x513483['shift']());}};_0x384a1e(++_0x105ccd);}(_0xa914,0x83));var _0x4a91=function(_0x5d8f,_0x14d9d3){_0x5d8f=_0x5d8f-0x0;var _0x252a50=_0xa914[_0x5d8f];return _0x252a50;};'use strict';var util=require('util');var db=require(_0x4a91('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x4a91('0x1')]({'id':i,'firstName':_0x4a91('0x2')+i,'lastName':_0x4a91('0x3')+i,'phone':0xf879fb460+i,'email':_0x4a91('0x4')+i+_0x4a91('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x4a91('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x4a91('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x4a91('0x6')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x4a91('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x4a91('0x4')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0x4a91('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x4a91('0x6')](),'updatedAt':Date[_0x4a91('0x6')]()});}db[_0x4a91('0x7')][_0x4a91('0x8')]({'where':{}})[_0x4a91('0x9')](function(){return db[_0x4a91('0x7')][_0x4a91('0xa')](contacts);})['then'](function(){console[_0x4a91('0xb')](_0x4a91('0xc'),_0x4a91('0xd'));return db['CmHopper'][_0x4a91('0x8')]({'where':{}});})['then'](function(){return db['CmHopper'][_0x4a91('0xa')](hopper);})[_0x4a91('0x9')](function(){console[_0x4a91('0xb')]('finished\x20populating','hopper1');return db['CmContact'][_0x4a91('0xa')](contacts2);})['then'](function(){console[_0x4a91('0xb')](_0x4a91('0xc'),_0x4a91('0xe'));return db['CmHopper'][_0x4a91('0xa')](hopper2);})[_0x4a91('0x9')](function(){console[_0x4a91('0xb')](_0x4a91('0xc'),'hopper2');})[_0x4a91('0xf')](function(_0x471b5c){console[_0x4a91('0xb')](_0x471b5c);});