Skip to content

Commit

Permalink
chore: update upload api to have allocation column as cause instead o…
Browse files Browse the repository at this point in the history
…f invocation
  • Loading branch information
vasco-santos committed Apr 18, 2024
1 parent 96b6d50 commit f4b15c6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
28 changes: 14 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions upload-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
"@ucanto/transport": "^9.1.1",
"@ucanto/validator": "^9.0.2",
"@web-std/fetch": "^4.1.0",
"@web3-storage/access": "^18.3.0",
"@web3-storage/capabilities": "^13.3.0",
"@web3-storage/access": "^18.3.1",
"@web3-storage/capabilities": "^13.3.1",
"@web3-storage/did-mailto": "^2.1.0",
"@web3-storage/upload-api": "^9.1.4",
"@web3-storage/upload-api": "^9.1.5",
"multiformats": "^13.1.0",
"nanoid": "^5.0.2",
"preact": "^10.14.1",
Expand Down
6 changes: 3 additions & 3 deletions upload-api/stores/allocations.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export function useAllocationsStorage(dynamoDb, tableName) {
digest: base58btc.decode(raw.multihash),
size: raw.size
},
invocation: Link.parse(raw.invocation)
cause: Link.parse(raw.cause)
}
}
},
Expand All @@ -98,15 +98,15 @@ export function useAllocationsStorage(dynamoDb, tableName) {
* @param {BlobAddInput} item
* @returns {ReturnType<AllocationsStorage['insert']>}
*/
insert: async ({ space, blob, invocation }) => {
insert: async ({ space, blob, cause }) => {
const insertedAt = new Date().toISOString()
const multihash58btc = base58btc.encode(blob.digest)

const item = {
space,
multihash: multihash58btc,
size: blob.size,
invocation: invocation.toString(),
cause: cause.toString(),
insertedAt,
}
const cmd = new PutItemCommand({
Expand Down

0 comments on commit f4b15c6

Please sign in to comment.