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