async function writeEvents(entry) {
  const entryJson = {
    workspaceId: entry.workspaceId,
    entryNumber: entry.entryNumber,
    events: entry.events.map((event) => event.toJson()),
  };
  return new Promise((resolve, reject) => {
    socket.emit('addEvents', entryJson, () => {
      resolve();
    });
  });
}
Add an entry to the database.
@param {!LocalEntry} entry The entry to be added to the database.
@returns {!Promise} Promise object that represents the success of the write.
@public