Line

You are reading the unreleased docs (next). See latest (v0.9)

ui/server/src/notesApi

(part of / ) -- the Notes API: durable, per-project drafts on this machine.

Cockpit server, next. Source: ui/server/src/notesApi.mjs.

Variables#

MAX_NOTES_REQUEST_BYTES#

const MAX_NOTES_REQUEST_BYTES: "1mb" = '1mb'

Defined in: ui/server/src/notesApi.mjs:21

Functions#

createNotesRouter()#

createNotesRouter(deps): any

Defined in: ui/server/src/notesApi.mjs:84

Parameters#

deps

getRoot names the open project; the two optional deps are test seams (state directory, clock).

clientOrigin?

string

getRoot

() => { ok: true; root: string; } | { body?: any; ok: false; status?: number; }

now?

() => string

stateDir?

string

Returns#

any


revFromHeader()#

revFromHeader(value): number

Defined in: ui/server/src/notesApi.mjs:46

If-Match: 3, "3" or W/"3" -> 3; anything else -> undefined (the store answers REV_REQUIRED / STALE_REV).

Parameters#

value

any

Returns#

number


summarize()#

summarize(note): object

Defined in: ui/server/src/notesApi.mjs:28

The list row: everything except the (up to 256 KiB) body and the plan itself.

Parameters#

note

any

Returns#

object

anchor

anchor: any

createdAt

createdAt: any = note.createdAt

hasPlan

hasPlan: boolean

id

id: any = note.id

planStale

planStale: boolean

preview

preview: string

processId

processId: any

rev

rev: any = note.rev

status

status: any = note.status

title

title: any = note.title

updatedAt

updatedAt: any = note.updatedAt