@hasna/todos 0.3.6 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -17,12 +17,17 @@ export const TASK_PRIORITIES = [
17
17
  ] as const;
18
18
  export type TaskPriority = (typeof TASK_PRIORITIES)[number];
19
19
 
20
+ // Plan statuses
21
+ export const PLAN_STATUSES = ["active", "completed", "archived"] as const;
22
+ export type PlanStatus = (typeof PLAN_STATUSES)[number];
23
+
20
24
  // Project
21
25
  export interface Project {
22
26
  id: string;
23
27
  name: string;
24
28
  path: string;
25
29
  description: string | null;
30
+ task_list_id: string | null;
26
31
  created_at: string;
27
32
  updated_at: string;
28
33
  }
@@ -31,6 +36,31 @@ export interface CreateProjectInput {
31
36
  name: string;
32
37
  path: string;
33
38
  description?: string;
39
+ task_list_id?: string;
40
+ }
41
+
42
+ // Plan
43
+ export interface Plan {
44
+ id: string;
45
+ project_id: string | null;
46
+ name: string;
47
+ description: string | null;
48
+ status: PlanStatus;
49
+ created_at: string;
50
+ updated_at: string;
51
+ }
52
+
53
+ export interface CreatePlanInput {
54
+ name: string;
55
+ project_id?: string;
56
+ description?: string;
57
+ status?: PlanStatus;
58
+ }
59
+
60
+ export interface UpdatePlanInput {
61
+ name?: string;
62
+ description?: string;
63
+ status?: PlanStatus;
34
64
  }
35
65
 
36
66
  // Task
@@ -38,6 +68,7 @@ export interface Task {
38
68
  id: string;
39
69
  project_id: string | null;
40
70
  parent_id: string | null;
71
+ plan_id: string | null;
41
72
  title: string;
42
73
  description: string | null;
43
74
  status: TaskStatus;
@@ -70,6 +101,7 @@ export interface CreateTaskInput {
70
101
  description?: string;
71
102
  project_id?: string;
72
103
  parent_id?: string;
104
+ plan_id?: string;
73
105
  status?: TaskStatus;
74
106
  priority?: TaskPriority;
75
107
  agent_id?: string;
@@ -86,6 +118,7 @@ export interface UpdateTaskInput {
86
118
  status?: TaskStatus;
87
119
  priority?: TaskPriority;
88
120
  assigned_to?: string;
121
+ plan_id?: string;
89
122
  tags?: string[];
90
123
  metadata?: Record<string, unknown>;
91
124
  version: number; // required for optimistic locking
@@ -94,6 +127,7 @@ export interface UpdateTaskInput {
94
127
  export interface TaskFilter {
95
128
  project_id?: string;
96
129
  parent_id?: string | null;
130
+ plan_id?: string;
97
131
  status?: TaskStatus | TaskStatus[];
98
132
  priority?: TaskPriority | TaskPriority[];
99
133
  assigned_to?: string;
@@ -149,6 +183,7 @@ export interface TaskRow {
149
183
  id: string;
150
184
  project_id: string | null;
151
185
  parent_id: string | null;
186
+ plan_id: string | null;
152
187
  title: string;
153
188
  description: string | null;
154
189
  status: string;
@@ -213,6 +248,13 @@ export class ProjectNotFoundError extends Error {
213
248
  }
214
249
  }
215
250
 
251
+ export class PlanNotFoundError extends Error {
252
+ constructor(public planId: string) {
253
+ super(`Plan not found: ${planId}`);
254
+ this.name = "PlanNotFoundError";
255
+ }
256
+ }
257
+
216
258
  export class LockError extends Error {
217
259
  constructor(
218
260
  public taskId: string,