Line

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

ui/client/features/notes/services/NotesApi

Durable Notes over ui/server's /api/notes.

Cockpit client (features), next. Source: ui/client/features/notes/services/NotesApi.ts.

Functions#

createNote()#

createNote(draft?, opts?): Promise<ApiResult<Note>>

Defined in: ui/client/features/notes/services/NotesApi.ts:34

anchor is for a caller that keeps a note of its own anchored to a specific place, e.g. the Pages editor's Inspector "Notes" section -- omitted entirely (not even null), the server's own default applies.

Parameters#

draft?

Partial<Draft> = {}

opts?
anchor?

NoteAnchor | null

Returns#

Promise<ApiResult<Note>>


duplicateNote()#

duplicateNote(id): Promise<ApiResult<Note>>

Defined in: ui/client/features/notes/services/NotesApi.ts:59

Parameters#

id

string

Returns#

Promise<ApiResult<Note>>


fetchNote()#

fetchNote(id): Promise<ApiResult<Note>>

Defined in: ui/client/features/notes/services/NotesApi.ts:22

Parameters#

id

string

Returns#

Promise<ApiResult<Note>>


listNotes()#

listNotes(): Promise<ApiResult<NoteRow[]>>

Defined in: ui/client/features/notes/services/NotesApi.ts:12

Returns#

Promise<ApiResult<NoteRow[]>>


removeNote()#

removeNote(id): Promise<ApiResult<string>>

Defined in: ui/client/features/notes/services/NotesApi.ts:69

Parameters#

id

string

Returns#

Promise<ApiResult<string>>


saveNote()#

saveNote(id, rev, draft, extra?): Promise<SaveResult>

Defined in: ui/client/features/notes/services/NotesApi.ts:48

Save against rev (sent as If-Match). 409 STALE_REV hands back the copy that won. extra carries a plan and its status when the caller (the Plan screen, ) saves one along with the text; the server marks the plan out of date when text is saved without one.

Parameters#

id

string

rev

number

draft

Draft

extra?
plan?

unknown

status?

NoteStatus

Returns#

Promise<SaveResult>