feat(tasks): add recurrency, rrule, reminder fields to get_tasks (v0.9.0)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -398,6 +398,7 @@ def get_tasks(list_id: str, only_open: bool = True):
|
||||
|
||||
_fw_debug = os.environ.get("FW_DEBUG") == "1"
|
||||
_known_fields = {
|
||||
# output fields
|
||||
"metaId",
|
||||
"text",
|
||||
"description",
|
||||
@@ -406,6 +407,34 @@ def get_tasks(list_id: str, only_open: bool = True):
|
||||
"dueDate",
|
||||
"assigneeIds",
|
||||
"taskListId",
|
||||
# recurrency fields
|
||||
"recurrency",
|
||||
"recurrencyInterval",
|
||||
"rrule",
|
||||
"byDay",
|
||||
"recurrencyDeletedOccurence",
|
||||
"reminder",
|
||||
# always-present housekeeping fields
|
||||
"moodStarShortcut",
|
||||
"bestMoment",
|
||||
"lastAction",
|
||||
"lastActionAuthor",
|
||||
"lastActionDate",
|
||||
"categories",
|
||||
"moodMap",
|
||||
"sortingIndex",
|
||||
"comments",
|
||||
"editable",
|
||||
"creationDate",
|
||||
"completedDate",
|
||||
"familyId",
|
||||
"toAll",
|
||||
"accountId",
|
||||
"medias",
|
||||
"modifDate",
|
||||
"assignee",
|
||||
"taskId",
|
||||
"clientOpId",
|
||||
}
|
||||
|
||||
result = []
|
||||
@@ -425,6 +454,20 @@ def get_tasks(list_id: str, only_open: bool = True):
|
||||
file=sys.stderr,
|
||||
)
|
||||
|
||||
raw_recurrency = task.get("recurrency")
|
||||
raw_interval = task.get("recurrencyInterval")
|
||||
recurrency_interval = int(raw_interval) if raw_interval is not None else None
|
||||
|
||||
raw_reminder = task.get("reminder")
|
||||
if raw_reminder and isinstance(raw_reminder, dict):
|
||||
raw_val = raw_reminder.get("value")
|
||||
reminder = {
|
||||
"unit": raw_reminder.get("unit"),
|
||||
"value": int(raw_val) if raw_val is not None else None,
|
||||
}
|
||||
else:
|
||||
reminder = None
|
||||
|
||||
result.append(
|
||||
{
|
||||
"id": task.get("metaId"),
|
||||
@@ -434,6 +477,10 @@ def get_tasks(list_id: str, only_open: bool = True):
|
||||
"category_id": task.get("taskCategoryId"),
|
||||
"due_date": task.get("dueDate"),
|
||||
"assignee_ids": task.get("assigneeIds") or [],
|
||||
"recurrency": raw_recurrency,
|
||||
"recurrency_interval": recurrency_interval,
|
||||
"rrule": task.get("rrule"),
|
||||
"reminder": reminder,
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user