Vault

create(name, options)

  • name (string, required) - new vault name

  • options (VaultCreateOptions, optional) - public/private, terms of access, etc.

  • returns Promise<{ vaultId, membershipId, transactionId }> - Promise with new vault id, owner membership id & corresponding transaction id

example
// create a private vault
const { vaultId, membershipId } = await akord.vault.create("my first private vault");

// create a public vault with terms of access
const { vaultId, membershipId } = await akord.vault.create(
  "my first public vault",
  { public: true, termsOfAccess: "terms of access here - if the vault is intended for professional or legal use, you can add terms of access and they must be digitally signed before accessing the vault" }
);

rename(vaultId, name)

  • vaultId (string, required)

  • name (string, required) - new vault name

  • returns Promise<{ transactionId }> - Promise with corresponding transaction id

example
const { transactionId } = await akord.vault.rename(vaultId, "updated name");

archive(vaultId)

  • vaultId (string, required)

  • returns Promise<{ transactionId }> - Promise with corresponding transaction id

example
const { transactionId } = await akord.vault.archive(vaultId);

restore(vaultId)

  • vaultId (string, required)

  • returns Promise<{ transactionId }> - Promise with corresponding transaction id

example
const { transactionId } = await akord.vault.restore(vaultId);

delete(vaultId)

  • vaultId (string, required)

  • returns Promise<{ transactionId }> - Promise with corresponding transaction id

example
const { transactionId } = await akord.vault.delete(vaultId);

get(vaultId, options)

  • vaultId (string, required)

  • options (VaultGetOptions, optional)

  • returns Promise<Vault> - Promise with the vault object

example
const vault = await akord.vault.get(vaultId);

listAll(options)

  • options (ListOptions, optional)

  • returns Promise<Array<Vault>> - Promise with currently authenticated user vaults

example
const vaults = await akord.vault.listAll();

list(listOptions)

  • options (ListOptions, optional)

  • returns Promise<{ items, nextToken }> - Promise with paginated user vaults

example
// retrieve first 100 user vaults
const { items } = await akord.vault.list();

// retrieve first 20 user vaults
const { items } = await akord.vault.list({ limit: 20 });

// iterate through all user vaults
let token = null;
let vaults = [];
do {
  const { items, nextToken } = await akord.vault.list({ nextToken: token });
  vaults = vaults.concat(items);
  token = nextToken;
} while (token);

Last updated