-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.json
More file actions
121 lines (121 loc) · 10.7 KB
/
Copy pathopenapi.json
File metadata and controls
121 lines (121 loc) · 10.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
{
"openapi": "3.1.0",
"info": {
"title": "TaskForge API",
"version": "1.0.0",
"description": "Token-authed REST API for the TaskForge personal task manager. The UI and external agents share these endpoints."
},
"servers": [{ "url": "/", "description": "This server" }],
"security": [{ "bearerAuth": [] }],
"components": {
"securitySchemes": {
"bearerAuth": { "type": "http", "scheme": "bearer", "description": "Send `Authorization: Bearer <token>`." }
},
"schemas": {
"Error": { "type": "object", "properties": { "error": { "type": "object", "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } },
"Subtask": { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "string" }, "done": { "type": "boolean" } } },
"Task": {
"type": "object",
"properties": {
"id": { "type": "string" },
"title": { "type": "string" },
"notes": { "type": "string" },
"category": { "type": ["string", "null"] },
"date": { "type": ["string", "null"], "description": "YYYY-MM-DD, null = inbox" },
"time": { "type": ["string", "null"], "description": "HH:MM" },
"deadline": { "type": ["string", "null"] },
"recurrence": { "type": "string", "enum": ["none", "daily", "weekdays", "weekly", "monthly"] },
"done": { "type": "boolean" },
"rolled": { "type": "boolean" },
"subtasks": { "type": "array", "items": { "$ref": "#/components/schemas/Subtask" } }
}
},
"TaskInput": {
"type": "object",
"required": ["title"],
"properties": {
"title": { "type": "string" }, "notes": { "type": "string" }, "category": { "type": "string" },
"date": { "type": ["string", "null"] }, "time": { "type": ["string", "null"] }, "deadline": { "type": ["string", "null"] },
"recurrence": { "type": "string", "enum": ["none", "daily", "weekdays", "weekly", "monthly"] },
"subtasks": { "type": "array", "items": { "type": "object", "properties": { "title": { "type": "string" }, "done": { "type": "boolean" } } } }
}
},
"Category": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "color": { "type": "string" }, "soft": { "type": "string" }, "sort": { "type": "integer" } } },
"AvailabilityBlock": { "type": "object", "properties": { "id": { "type": "string" }, "label": { "type": "string" }, "days": { "type": "array", "items": { "type": "integer" } }, "start": { "type": "string" }, "end": { "type": "string" }, "color": { "type": "string" } } },
"Stats": { "type": "object", "properties": { "completed_total": { "type": "integer" }, "last_milestone": { "type": "integer" }, "streak": { "type": "integer" }, "last_completed_date": { "type": ["string", "null"] } } },
"PlanItem": { "type": "object", "properties": { "taskId": { "type": "string" }, "title": { "type": "string" }, "category": { "type": "string" }, "date": { "type": "string" }, "reason": { "type": "string" } } }
}
},
"paths": {
"/api/health": { "get": { "summary": "Health check", "security": [], "responses": { "200": { "description": "OK" } } } },
"/api/state": { "get": { "summary": "Bootstrap bundle", "responses": { "200": { "description": "Everything the UI needs" }, "401": { "description": "Unauthorized" } } } },
"/api/tasks": {
"get": {
"summary": "List tasks",
"parameters": [
{ "name": "inbox", "in": "query", "schema": { "type": "boolean" } },
{ "name": "date", "in": "query", "schema": { "type": "string" } },
{ "name": "from", "in": "query", "schema": { "type": "string" } },
{ "name": "to", "in": "query", "schema": { "type": "string" } },
{ "name": "category", "in": "query", "schema": { "type": "string" } },
{ "name": "done", "in": "query", "schema": { "type": "boolean" } },
{ "name": "q", "in": "query", "schema": { "type": "string" } }
],
"responses": { "200": { "description": "Task list" } }
},
"post": { "summary": "Create task", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TaskInput" } } } }, "responses": { "201": { "description": "Created" }, "400": { "description": "Validation error" } } }
},
"/api/tasks/reorder": { "post": { "summary": "Reorder tasks", "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "ids": { "type": "array", "items": { "type": "string" } } } } } } }, "responses": { "200": { "description": "OK" } } } },
"/api/tasks/{id}": {
"parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }],
"get": { "summary": "Get task", "responses": { "200": { "description": "Task" }, "404": { "description": "Not found" } } },
"patch": { "summary": "Update task", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TaskInput" } } } }, "responses": { "200": { "description": "Updated" } } },
"delete": { "summary": "Delete task", "responses": { "200": { "description": "OK" } } }
},
"/api/tasks/{id}/complete": { "post": { "summary": "Complete task/instance", "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "date", "in": "query", "schema": { "type": "string" }, "description": "Required for recurring tasks" }], "responses": { "200": { "description": "Result incl. stats + milestone" }, "400": { "description": "Missing date for recurring" } } } },
"/api/tasks/{id}/uncomplete": { "post": { "summary": "Uncomplete task/instance", "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "date", "in": "query", "schema": { "type": "string" } }], "responses": { "200": { "description": "OK" } } } },
"/api/tasks/{id}/subtasks": { "post": { "summary": "Add subtask", "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "title": { "type": "string" } } } } } }, "responses": { "201": { "description": "Created" } } } },
"/api/subtasks/{id}": {
"parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }],
"patch": { "summary": "Update subtask", "responses": { "200": { "description": "OK" } } },
"delete": { "summary": "Delete subtask", "responses": { "200": { "description": "OK" } } }
},
"/api/calendar": { "get": { "summary": "Recurrence-expanded calendar", "parameters": [{ "name": "from", "in": "query", "schema": { "type": "string" } }, { "name": "to", "in": "query", "schema": { "type": "string" } }, { "name": "category", "in": "query", "schema": { "type": "string" } }], "responses": { "200": { "description": "Instances by date" } } } },
"/api/today": { "get": { "summary": "Today's tasks (rollover applied)", "responses": { "200": { "description": "OK" } } } },
"/api/inbox": { "get": { "summary": "Inbox tasks", "responses": { "200": { "description": "OK" } } } },
"/api/categories": {
"get": { "summary": "List categories", "responses": { "200": { "description": "OK" } } },
"post": { "summary": "Create category", "responses": { "201": { "description": "Created" } } }
},
"/api/categories/{id}": {
"parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }],
"patch": { "summary": "Update category", "responses": { "200": { "description": "OK" } } },
"delete": { "summary": "Delete category", "responses": { "200": { "description": "OK" } } }
},
"/api/availability": {
"get": { "summary": "List protected-time blocks", "responses": { "200": { "description": "OK" } } },
"post": { "summary": "Create block", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AvailabilityBlock" } } } }, "responses": { "201": { "description": "Created" } } }
},
"/api/availability/{id}": {
"parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }],
"patch": { "summary": "Update block", "responses": { "200": { "description": "OK" } } },
"delete": { "summary": "Delete block", "responses": { "200": { "description": "OK" } } }
},
"/api/schedule/plan": { "post": { "summary": "Propose a schedule", "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "perDay": { "type": "integer" }, "horizon": { "type": "integer" }, "mode": { "type": "string", "enum": ["heuristic", "claude"] } } } } } }, "responses": { "200": { "description": "Plan proposals" } } } },
"/api/schedule/apply": { "post": { "summary": "Apply placements", "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "placements": { "type": "array", "items": { "type": "object", "properties": { "taskId": { "type": "string" }, "date": { "type": "string" } } } } } } } } }, "responses": { "200": { "description": "OK" } } } },
"/api/stats": { "get": { "summary": "Gamification stats", "responses": { "200": { "description": "OK" } } } },
"/api/rewards": { "get": { "summary": "List reward slots", "responses": { "200": { "description": "OK" } } } },
"/api/rewards/{level}": {
"parameters": [{ "name": "level", "in": "path", "required": true, "schema": { "type": "integer" } }],
"get": { "summary": "Get reward", "responses": { "200": { "description": "OK" } } },
"put": { "summary": "Attach media", "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "media_url": { "type": "string" }, "media_type": { "type": "string" }, "title": { "type": "string" } } } } } }, "responses": { "200": { "description": "OK" } } }
},
"/api/rewards/{level}/generate": { "post": { "summary": "Generate reward media (hook)", "parameters": [{ "name": "level", "in": "path", "required": true, "schema": { "type": "integer" } }], "responses": { "501": { "description": "Not configured" } } } },
"/api/tokens": {
"get": { "summary": "List tokens", "responses": { "200": { "description": "OK" } } },
"post": { "summary": "Create token (value shown once)", "responses": { "201": { "description": "Created" } } }
},
"/api/tokens/{id}": { "delete": { "summary": "Delete token", "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }], "responses": { "200": { "description": "OK" } } } },
"/api/maintenance/rollover": { "post": { "summary": "Run rollover now", "responses": { "200": { "description": "OK" } } } }
}
}