gitoria

jukebox

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Branchrecords-day39d6b3e068|||PR Records: day39 live (PR #2), mission 011 PR step, statusmrerecords-day39/lib/api-helpers.hl

943 B

  1. // lib/api-helpers.hl — the plumbing of the function routes (lib/api.hl): JSON answers, query numbers.
  2. import { Response } from 'hl:http1'
  3. import { leadingInt } from './util.hl'
  4. static jsonHeaders = { 'Content-Type' = 'application/json; charset=utf-8' 'X-Content-Type-Options' = 'nosniff' 'Cache-Control' = 'no-store' }
  5. static reply = (status, value) => {
  6. return new Response(JSON.stringify(value), { status = status headers = jsonHeaders })
  7. }
  8. static fail = (status, message) => { return reply(status, { error = message }) }
  9. // a query value as a non-negative whole Number, or null (missing or not a number)
  10. static queryNumber = (req, name) => {
  11. v = req.query == null ? null : req.query[name]
  12. if (v == null || hlTypeName(v) != 'String') { return null }
  13. return leadingInt(v)
  14. }
  15. static queryText = (req, name) => {
  16. v = req.query == null ? null : req.query[name]
  17. return v == null || hlTypeName(v) != 'String' || v == '' ? null : v
  18. }

Branches

Latest commits

  • d6b3e068|||PR Records: day39 live (PR #2), mission 011 PR step, statusmre
  • 5fa19e89Merge branch 'day39' into mainJukebox
  • cfe95440|||PR day39 re-vendor: Hybriel 51e921d7 (bin 6b481aa7), ids kebab-case since hybriel#256: quoted state rule and tests use jb-shuffle / jb-repeatmre
  • f3614c9bRe-vendor to Hybriel day39 (51e921d7, bin 6b481aa7)mre
  • 9f5c6532Merge branch 'status-22-pr' into mainJukebox
  • 5838d6c7|||PR STATUS: #22 pending decision, PR-only rulemre
  • 29d2029cRecords: PR-only rule (Kunibert)mre
  • adacb0abRecords: neutral ticket rule, #22 decision recordedmre
  • b2d6f121Records: #308 hold liftedmre
  • 7ab67533Records: day39 on hold (hybriel#308)mre
  • 22f21739Records: note rebase before mergemre
  • f7368ea3Records: mission 011 day39, waits for lisbethmre
  • 9515d2cdRecords: jb20 livemre
  • 019f6601ui gate: comment names the open bug components#27 (workaround, not fixed)mre
  • 277a2722README: provenance linemre
  • 4169ca6aREADME: sync pinmre
  • a01f3aa8ui gate: back to the top before the sort checks (the screen reopens where it was left)mre
  • f7936c20Lists keep their scroll position across a reload (jukebox#20): per-list offsets in storage/ui.json, gate jb20mre
  • d67906devirtual-list and icons from components.hybriel e5b98ec (centerId, scrollTop, onScroll)mre
  • df7920ceRecords: R3 startedmre