gitoriaLog in with ident

ident

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit7423581574235815ident mission 009 (4/4): docs (README files map + same-output test, STATUS, LOG), report, tests/letcount.py + realdata-baseline/comparemre74235815/lib/invites-helpers.hl

1.4 KB

  1. // lib/invites-helpers.hl — what lib/invites.hl looks up: the text and number checks of the app's call, the
  2. // list of identities that accepted, the message of a state. No table access. Statics only.
  3. import { hasControl } from './util.hl'
  4. static maxText = 60
  5. static isWhole = (n) => { return hlTypeName(n) == 'Number' && !('' + n).includes('.') && !('' + n).includes('e') }
  6. static checkText = (v, name) => {
  7. if (v == null || hlTypeName(v) != 'String') { return { error = 'field ' + name + ' must be a string' } }
  8. t = v.trim()
  9. if (t == '') { return { error = 'field ' + name + ' is empty' } }
  10. if (t.length > maxText) { return { error = 'field ' + name + ' is longer than ' + maxText + ' characters' } }
  11. if (hasControl(t)) { return { error = 'field ' + name + ' contains a control character' } }
  12. return { text = t }
  13. }
  14. // `acceptedBy` is 'a b c': the identities' short ids that accepted it, space separated
  15. static acceptedList = (rec) => { return rec.acceptedBy == null || rec.acceptedBy == '' ? [] : rec.acceptedBy.split(' ') }
  16. static usedCount = (rec) => { return acceptedList(rec).length }
  17. // the message of a state that cannot be accepted
  18. static problemOf = (state) => {
  19. if (state == 'used') { return 'This invitation was already used.' }
  20. if (state == 'expired') { return 'This invitation has expired. Ask whoever invited you for a new one.' }
  21. if (state == 'revoked') { return 'This invitation was withdrawn. Ask whoever invited you for a new one.' }
  22. return ''
  23. }

Branches

Latest commits

  • 74235815ident mission 009 (4/4): docs (README files map + same-output test, STATUS, LOG), report, tests/letcount.py + realdata-baseline/comparemre
  • fe183516ident mission 009 (3/4): let only where reassigned — 293 never-reassigned lets are plain declarations; kept: reassigned, loop bodies, names of a file member, a name declared twice in one function; same outputmre
  • d2e7f91bident mission 009 (2/4): one lib file per topic (login, accounts, identities, apps, invites, selector, notify + helpers, util), function routes as thin wrappers in lib/api.hl, project.hl = the map; same outputmre
  • 91017164ident mission 009 (1/4): file moves — the root .hl files into lib/ (api.hl → lib/api-helpers.hl), styles.hl → components/styles.hl; imports adjusted, no other changemre
  • f8bdcbc2ident: Hybriel master 06617221 (plugin allocators 3a781359 + 413f60e4, mpackdb 2cb7ae5e, http1 773de63e); all gates greenmre
  • ff78726cident: Hybriel master 190aa11d (fc838894 GC correctness, #127, #126 closure scopes); gates all greenmre
  • a3a7d21aident: Hybriel master 8efba065 (#126 GC by bytes, #48 lambda params copy); session-writing lambdas take &sessionmre
  • 98226b41antcolony#40: mission references point to the moved missionsmre
  • ff805b9aantcolony#40: history (LOG.md), worker briefs (missions/) and reports moved here from antcolony, numbered per project; old numbers in antcolony docs/mission-map.mdmre
  • 51a7bcdfident: Hybriel master 73267707 (#122); /code uses the new page() signature; pending address passed as parameter; once-checksmre
  • 836f644fident#24: installable app (manifest, service worker, data-free offline /start), own iconmre
  • 8bebbbf2deploy.sh: back up live storage/.sessions/.env before every deploy (newest 5 kept)mre
  • cc063ea2deploy.sh: never send .git or .gitignore to Byrodinmre
  • 81b15b7bState of 2026-09-27, before the move to gitoriamre