Files

33 lines
1.4 KiB
TypeScript

// The module's closed vocabularies and names, in a file with no import: a browser bundle can take
// them without loading the data layer the schemas live beside.
/** The audit events this module writes (spec §9.4), declared in its manifest. */
export const NOTE_CREATED = "notes.note_created"
export const NOTE_UPDATED = "notes.note_updated"
export const NOTE_DELETED = "notes.note_deleted"
export const ATTACHMENT_ADDED = "notes.attachment_added"
export const ATTACHMENT_REMOVED = "notes.attachment_removed"
/** The usage meter: one fact per note created, metered against the organization that owns it. */
export const NOTES_CREATED_METER = "notes_created"
/**
* The module's feature flag and its default. An app or the platform's flag service may switch
* attachments off per organization or per deployment by binding `NOTES_FLAGS`; with nothing bound
* the default below is the answer, so a deployment that has no flag service still behaves.
*/
export const ATTACHMENTS_FLAG = "notes.attachments"
export const NOTES_FLAG_DEFAULTS = { [ATTACHMENTS_FLAG]: true } as const
/** The most attachments one note may carry: a note is a note, not a folder. */
export const MAX_ATTACHMENTS = 20
/** The content types an attachment may have. The server enforces them; the file picker only hints. */
export const ATTACHMENT_CONTENT_TYPES = [
"application/pdf",
"image/png",
"image/jpeg",
"image/webp",
"text/plain",
] as const