Stack (file)
In an Akord vault, files and other assets are organized as 'stacks'. A stack represents one single file and all the subsequent revisions that may come after.
create(vaultId, file, options)
vaultId(string, required)file(FileLike, required) - file object - web: File, node: NodeJs.File (Blob implementation; web like File)options(StackCreateOptions, optional)returns
Promise<{ stackId, transactionId, uri }>- Promise with new stack id & corresponding transaction id
import(vaultId, fileTxId)
Create new stack from an existing arweave file transaction:
vaultId(string, required)fileTxId(string, required) - arweave file transaction id referenceoptions(NodeCreateOptions, optional) - parent id, etc.returns
Promise<{ stackId, transactionId }>- Promise with new stack id & corresponding transaction id
rename(stackId, name)
stackId(string, required)name(string, required) - new stack namereturns
Promise<{ transactionId }>- Promise with corresponding transaction id
uploadRevision(stackId, file)
stackId(string, required)file(FileLike, required) - file objectoptions(FileUploadOptions, optional)returns
Promise<{ transactionId }>- Promise with corresponding transaction id
revoke(stackId)
stackId(string, required)returns
Promise<{ transactionId }>- Promise with corresponding transaction id
move(stackId, parentId)
stackId(string, required)parentId(string, required) - new parent folder idreturns
Promise<{ transactionId }>- Promise with corresponding transaction id
restore(stackId)
stackId(string, required)returns
Promise<{ transactionId }>- Promise with corresponding transaction id
delete(stackId)
stackId(string, required)returns
Promise<{ transactionId }>- Promise with corresponding transaction id
get(stackId, options)
stackId(string, required)options(GetOptionsoptional)returns
Promise<Stack>- Promise with the stack object
listAll(vaultId, options)
vaultId(string, required)options(ListOptions, optional)returns
Promise<Array<Stack>>- Promise with all stacks within given vault
list(vaultId, options)
vaultId(string, required)options(ListOptions, optional)returns
Promise<{ items, nextToken }>- Promise with paginated stacks within given vault
getVersion(stackId, index)
Get file stack version by index, return the latest version by default:
stackId(string, required)index(number, optional) - file version indexreturns
Promise<{ name: string, data: ArrayBuffer }>- Promise with file name & data buffer
getUri(stackId, type, index)
Get stack file uri by index, return the latest arweave uri by default:
stackId(string, required)type(StorageType, optional) - storage type, default to arweaveindex(number, optional) - file version index, default to latestreturns
Promise<string>- Promise with stack file uri
Last updated
Was this helpful?