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