Genesis

Packages

@marktiderman/genesis-tasks

0.1.1Primitive · Data

The task sync layer: a person's tasks kept equal with an outside list. The shared fields, a three-way merge that never loses an edit, and Todoist's adapter: incremental sync with its sync token, batched commands with idempotent uuids, temp ids and per-command results, and checked webhooks. Pure TypeScript, no storage, no OAuth (genesis-connect's todoistProvider), no React. Part of the Genesis framework.

The task sync layer: a person's tasks kept equal with an outside list, both ways, without losing an edit on either side. Todoist is built in.

- **`TaskFields`**: what a two-way sync keeps equal (title, notes, due day, done). Everything else on the outside task (priority, labels, a due time, a recurrence) stays the outside list's and is never written from your side. - **`mergeTask`**: a three-way merge, field by field, against the last state both sides agreed on. A title changed in the app and the task ticked off in Todoist keeps both. - **Todoist**: `syncTodoist` (a full read, then only changes, with the sync token), `runTodoistCommands` with `todoistCommand` (batched, at most 100 a request, each with a uuid Todoist runs once, so retrying is safe), `getTodoistTask`, and `readTodoistWebhook` (the signature checked on the raw body).

pnpm add @marktiderman/genesis-tasks

READMEChangelognpm

@marktiderman/genesis-tasks

Other exports (14)

fromTodoistItem · getTodoistTask · isTodoistError · matchesScope · mergeTask · normalizeLabels · normalizeTaskFields · readTodoistWebhook · runTodoistCommands · syncTodoist · TASK_FIELDS · TODOIST_MAX_COMMANDS · todoistCommand · TodoistError

And 22 types.