@evervault/sdk
Advanced tools
Comparing version 1.1.2 to 1.1.3
@@ -17,7 +17,12 @@ const path = require('path'); | ||
const cageLock = getCageLockIfExists(); | ||
return cageLock === false || !cageLock.cages.includes(sourceHash); | ||
return cageLock === false || !Object.keys(cageLock.cages).includes(sourceHash); | ||
}; | ||
const addCageToLockfile = (cage, deployedBy, deployedTeam) => { | ||
const existingLockfile = getCageLockIfExists() || { cages: [] }; | ||
const existingLockfile = getCageLockIfExists() || { cages: {} }; | ||
existingLockfile.cages[cage] = { | ||
deployedBy, | ||
deployedTeam, | ||
deployedAt: new Date().toString() | ||
}; | ||
@@ -27,5 +32,5 @@ fs.writeFileSync(getLockfilePath(), JSON.stringify({ | ||
updatedAt: new Date().toString(), | ||
cages: existingLockfile.cages.concat([ cage ]), | ||
deployedBy, | ||
deployedTeam | ||
cages: existingLockfile.cages, | ||
lastUpdatedBy: deployedBy, | ||
lastUpdatedTeam: deployedTeam | ||
}, null, 2)); | ||
@@ -32,0 +37,0 @@ } |
@@ -53,3 +53,6 @@ const path = require('path'); | ||
deployedBy: installed.toString().split('Signed in as: ')[1].split("\n")[0], | ||
deployedTeam: installed.toString().split('Active team: ')[1].split("\n")[0] | ||
deployedTeam: { | ||
name: installed.toString().split('Active team: ')[1].split("\n")[0], | ||
id: installed.toString().split('(').split('(').reverse()[0].split(')')[0].split('\n')[0] | ||
} | ||
}; | ||
@@ -56,0 +59,0 @@ } |
{ | ||
"name": "@evervault/sdk", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"description": "Node.js SDK for working with evervault cages", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
47101
26
1236