async function getSnapshot() {
  const response = await fetch('/api/snapshot/query');
  const responseJson = await response.json();
  const snapshot = responseJson.snapshot;
  snapshot.xml = Blockly.utils.xml.textToDom(snapshot.xml);
  if (response.status === 200) {
    return snapshot;
  } else {
    throw 'Failed to get workspace snapshot.';
  }
}
Get a snapshot of the current workspace.
@returns {!Snapshot} The latest snapshot of the workspace.
@public