Note

create(vaultId, content, name)

  • vaultId (string, required)

  • content (string, required) - note text content, ex: stringified JSON

  • name (string, required) - note name

  • options (NoteCreateOptions, optional) - parent id, mime type, etc.

  • returns Promise<{ noteId, transactionId }> - Promise with new note id & corresponding transaction id

example
const { noteId } = await akord.note.create(vaultId, "# Hello World", "Hello World note");

const { noteId } = await akord.note.create(
  vaultId,
  JSON.stringify({ name: "My first JSON note" }),
  "My first JSON note",
  { parentId: parentId, mimeType: "application/json" }
);

uploadRevision(noteId, name, content)

  • noteId (string, required)

  • content (string, required) - note text content, ex: stringified JSON

  • name (string, required) - note name

  • options (NoteOptions, optional) - mime type, etc.

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

example
const { transactionId } = await akord.note.uploadRevision(noteId, "# Hello World bis", "Hello World note bis");

move(noteId, parentId)

  • noteId (string, required)

  • parentId (string, optional) - new parent folder id

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

example

revoke(noteId)

  • noteId (string, required)

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

example

restore(noteId)

  • noteId (string, required)

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

example

delete(noteId)

  • noteId (string, required)

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

example

get(noteId, options)

  • noteId (string, required)

  • options (GetOptions, optional)

  • returns Promise<Note> - Promise with the note object

example

listAll(vaultId, options)

  • vaultId (string, required)

  • options (ListOptions, optional)

  • returns Promise<Array<Note>> - Promise with all notes within given vault

example

list(vaultId, options)

  • vaultId (string, required)

  • options (ListOptions, optional)

  • returns Promise<{ items, nextToken }> - Promise with paginated notes within given vault

example

getVersion(noteId, index)

Get note text version by index, return the latest version by default

  • noteId (string, required)

  • index (number, optional) - note version index

  • returns Promise<{ name: string, data: string }> - Promise with note name & data string text

example

Last updated

Was this helpful?