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