@vibetasks/core 0.3.0 → 0.4.2
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 +29 -1
- package/dist/index.js +36 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -132,10 +132,27 @@ interface Tag {
|
|
|
132
132
|
* - archived: Archived (hidden from default views)
|
|
133
133
|
*/
|
|
134
134
|
type TaskStatus = 'todo' | 'vibing' | 'done' | 'archived';
|
|
135
|
+
interface Subtask {
|
|
136
|
+
id: string;
|
|
137
|
+
title: string;
|
|
138
|
+
done: boolean;
|
|
139
|
+
notes?: string;
|
|
140
|
+
}
|
|
141
|
+
interface Attachment {
|
|
142
|
+
id: string;
|
|
143
|
+
task_id: string;
|
|
144
|
+
file_name: string;
|
|
145
|
+
file_type: string;
|
|
146
|
+
storage_path: string;
|
|
147
|
+
is_image?: boolean;
|
|
148
|
+
alt_text?: string;
|
|
149
|
+
ai_description?: string;
|
|
150
|
+
}
|
|
135
151
|
interface Task {
|
|
136
152
|
id: string;
|
|
137
153
|
user_id?: string;
|
|
138
154
|
title: string;
|
|
155
|
+
description?: string;
|
|
139
156
|
notes?: string;
|
|
140
157
|
notes_format?: 'html' | 'markdown';
|
|
141
158
|
completed?: boolean;
|
|
@@ -153,8 +170,9 @@ interface Task {
|
|
|
153
170
|
created_at?: string;
|
|
154
171
|
updated_at?: string;
|
|
155
172
|
tags?: Tag[];
|
|
156
|
-
attachments?:
|
|
173
|
+
attachments?: Attachment[];
|
|
157
174
|
subtasks?: Task[];
|
|
175
|
+
subtasks_json?: Subtask[];
|
|
158
176
|
status?: TaskStatus;
|
|
159
177
|
project_tag?: string;
|
|
160
178
|
created_by?: 'ai' | 'human';
|
|
@@ -201,6 +219,16 @@ declare class TaskOperations {
|
|
|
201
219
|
* Find tag by name (case-insensitive), create if doesn't exist
|
|
202
220
|
*/
|
|
203
221
|
findOrCreateTag(name: string, color?: string): Promise<Tag>;
|
|
222
|
+
/**
|
|
223
|
+
* Get a signed URL for an attachment (valid for 1 hour)
|
|
224
|
+
*/
|
|
225
|
+
getAttachmentUrl(storagePath: string): Promise<string>;
|
|
226
|
+
/**
|
|
227
|
+
* Get all attachments for a task with signed URLs
|
|
228
|
+
*/
|
|
229
|
+
getTaskAttachments(taskId: string): Promise<(Attachment & {
|
|
230
|
+
url: string;
|
|
231
|
+
})[]>;
|
|
204
232
|
}
|
|
205
233
|
|
|
206
234
|
/**
|
package/dist/index.js
CHANGED
|
@@ -321,12 +321,16 @@ var TaskOperations = class _TaskOperations {
|
|
|
321
321
|
async getTask(taskId) {
|
|
322
322
|
const { data, error } = await this.supabase.from("tasks").select(`
|
|
323
323
|
*,
|
|
324
|
-
tags:task_tags(tag:tags(*))
|
|
324
|
+
tags:task_tags(tag:tags(*)),
|
|
325
|
+
attachments:task_attachments(*)
|
|
325
326
|
`).eq("id", taskId).single();
|
|
326
327
|
if (error) throw error;
|
|
327
328
|
return {
|
|
328
329
|
...data,
|
|
329
|
-
tags: data.tags?.map((t) => t.tag).filter(Boolean) || []
|
|
330
|
+
tags: data.tags?.map((t) => t.tag).filter(Boolean) || [],
|
|
331
|
+
attachments: data.attachments || [],
|
|
332
|
+
subtasks_json: data.subtasks || []
|
|
333
|
+
// DB column is 'subtasks', maps to subtasks_json
|
|
330
334
|
};
|
|
331
335
|
}
|
|
332
336
|
async createTask(task) {
|
|
@@ -335,6 +339,7 @@ var TaskOperations = class _TaskOperations {
|
|
|
335
339
|
const { data, error } = await this.supabase.from("tasks").insert({
|
|
336
340
|
user_id: user.id,
|
|
337
341
|
title: task.title,
|
|
342
|
+
description: task.description,
|
|
338
343
|
notes: task.notes,
|
|
339
344
|
notes_format: task.notes_format || "markdown",
|
|
340
345
|
due_date: task.due_date,
|
|
@@ -346,6 +351,8 @@ var TaskOperations = class _TaskOperations {
|
|
|
346
351
|
priority: task.priority || "none",
|
|
347
352
|
parent_task_id: task.parent_task_id,
|
|
348
353
|
position: task.position || 0,
|
|
354
|
+
subtasks: task.subtasks_json || [],
|
|
355
|
+
// Inline subtasks as JSON
|
|
349
356
|
// VibeTasks-specific fields
|
|
350
357
|
status: task.status || "todo",
|
|
351
358
|
project_tag: task.project_tag,
|
|
@@ -362,6 +369,7 @@ var TaskOperations = class _TaskOperations {
|
|
|
362
369
|
async updateTask(taskId, updates) {
|
|
363
370
|
const updateData = {};
|
|
364
371
|
if (updates.title !== void 0) updateData.title = updates.title;
|
|
372
|
+
if (updates.description !== void 0) updateData.description = updates.description;
|
|
365
373
|
if (updates.notes !== void 0) updateData.notes = updates.notes;
|
|
366
374
|
if (updates.notes_format !== void 0) updateData.notes_format = updates.notes_format;
|
|
367
375
|
if (updates.completed !== void 0) {
|
|
@@ -376,6 +384,7 @@ var TaskOperations = class _TaskOperations {
|
|
|
376
384
|
if (updates.recurrence_end !== void 0) updateData.recurrence_end = updates.recurrence_end;
|
|
377
385
|
if (updates.priority !== void 0) updateData.priority = updates.priority;
|
|
378
386
|
if (updates.position !== void 0) updateData.position = updates.position;
|
|
387
|
+
if (updates.subtasks_json !== void 0) updateData.subtasks = updates.subtasks_json;
|
|
379
388
|
if (updates.status !== void 0) updateData.status = updates.status;
|
|
380
389
|
if (updates.project_tag !== void 0) updateData.project_tag = updates.project_tag;
|
|
381
390
|
if (updates.created_by !== void 0) updateData.created_by = updates.created_by;
|
|
@@ -504,6 +513,31 @@ var TaskOperations = class _TaskOperations {
|
|
|
504
513
|
}
|
|
505
514
|
return await this.createTag(name, color);
|
|
506
515
|
}
|
|
516
|
+
// ============================================
|
|
517
|
+
// ATTACHMENT OPERATIONS
|
|
518
|
+
// ============================================
|
|
519
|
+
/**
|
|
520
|
+
* Get a signed URL for an attachment (valid for 1 hour)
|
|
521
|
+
*/
|
|
522
|
+
async getAttachmentUrl(storagePath) {
|
|
523
|
+
const { data, error } = await this.supabase.storage.from("task-attachments").createSignedUrl(storagePath, 3600);
|
|
524
|
+
if (error) throw error;
|
|
525
|
+
return data.signedUrl;
|
|
526
|
+
}
|
|
527
|
+
/**
|
|
528
|
+
* Get all attachments for a task with signed URLs
|
|
529
|
+
*/
|
|
530
|
+
async getTaskAttachments(taskId) {
|
|
531
|
+
const { data, error } = await this.supabase.from("task_attachments").select("*").eq("task_id", taskId);
|
|
532
|
+
if (error) throw error;
|
|
533
|
+
const attachmentsWithUrls = await Promise.all(
|
|
534
|
+
(data || []).map(async (attachment) => {
|
|
535
|
+
const url = await this.getAttachmentUrl(attachment.storage_path);
|
|
536
|
+
return { ...attachment, url };
|
|
537
|
+
})
|
|
538
|
+
);
|
|
539
|
+
return attachmentsWithUrls;
|
|
540
|
+
}
|
|
507
541
|
};
|
|
508
542
|
|
|
509
543
|
// src/claude-sync.ts
|
package/package.json
CHANGED