Using pnp to generate unique id

I have a scenario which based on project Type I need to generate unique id and save in SOW Number field , I have created another list and made 3 types of project with id field in spsaved I need to call setSOWID function but cant figure out pnp syntax for that, I need to retrieve first starting number from config list then make the sow title in main list and set that then I need to update that id plus one for next one.... its 3 pnp call but seems my syntax is not ight

Dear @Ghazalsrs,
Do you need the ID to be sequential? If not, you can simply generate a GUID - javascript - How do I create a GUID / UUID? - Stack Overflow

If you do need a sequential ID, please, share your code, we'll help adjusting it.

yes it needs to be sequential and each category starts from different number
this is my code but dosnt work and im calling this in spsaved function

if (sowType === "Project SOW (eg DES-SOW-0001)"){
pnp.sp.web.lists.getByTitle("SOW No Config").items.getById(1).get().then(function(item){
return item

}).then(function(item){
pnp.sp.web.lists.getByTitle("Engagements").items.getById(engagementId).update({
SOWNumber: "DES-SOW" + "-" + item.SOWID ,
Title : "DES-SOW" + "-" + item.SOWID
});
});

pnp.sp.web.lists.getByTitle("SOW No Config").items.getById(1).get().then(function(item){
return item
}).then(function(item){
pnp.sp.web.lists.getByTitle("SOW No Config").items.getById(1).update({
SOWID: item.SOWID + 1
});
});

createEngagementDocumentFolders();
}
}