ShtukbaseStandard
package file→ .shtukbase/packages/lenses/kit/server/queue.html

kit/server/queue.html

12 lines, 1.0 KB.

  1. <!doctype html><meta charset="utf-8"><title>q</title><div id="out">none</div>
  2. <script>
  3. const call = (o) => fetch('/_api', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify(o) }).then((r) => r.json());
  4. (async () => {
  5. const before = (await call({ do: 'records', from: 'questions' })).result.filter((r) => r.status === 'open');
  6. await call({ do: 'patch', path: before[0].path, set: { status: 'answered', answer: 'option B' } });
  7. const after = (await call({ do: 'records', from: 'questions' })).result.filter((r) => r.status === 'open');
  8. const md = (await (await fetch('../notes/readme.md')).text()).trim();
  9. const out = await call({ do: 'read', path: '../secret.txt' }), dot = await call({ do: 'read', path: '.env' });
  10. document.getElementById('out').textContent = ['open before ' + before.length, 'open after ' + after.length, 'md: ' + md, 'outside: ' + (out.error || 'LEAK'), 'dot: ' + (dot.error || 'LEAK')].join(' | ');
  11. })().catch((e) => { document.getElementById('out').textContent = 'ERR ' + e; });
  12. </script>