@perspectask/sdk 0.0.4 → 0.0.5
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/README.md +4 -0
- package/dist/index.cjs +189 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +193 -1
- package/dist/index.d.ts +193 -1
- package/dist/index.js +167 -1
- package/dist/index.js.map +1 -1
- package/package.json +15 -9
package/dist/index.d.cts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import * as z from 'zod/mini';
|
|
2
|
+
|
|
1
3
|
type AuthToken = string | undefined;
|
|
2
4
|
interface Auth {
|
|
3
5
|
/**
|
|
@@ -316,6 +318,9 @@ type ClientOptions = {
|
|
|
316
318
|
baseUrl: 'https://api.perspectask.com/v1' | (string & {});
|
|
317
319
|
};
|
|
318
320
|
type Task = {
|
|
321
|
+
/**
|
|
322
|
+
* Short id: the minimum unique prefix of the task UUID (e.g. "a3f"). Accepted anywhere an id is.
|
|
323
|
+
*/
|
|
319
324
|
id?: string;
|
|
320
325
|
title?: string;
|
|
321
326
|
description?: string;
|
|
@@ -345,6 +350,10 @@ type Task = {
|
|
|
345
350
|
* When the task was created. Omitted by default. Present only when requested: `?showCreated=true` returns a relative time (e.g. "5 minutes ago"), `?showCreatedDate=true` returns an absolute ISO 8601 timestamp.
|
|
346
351
|
*/
|
|
347
352
|
created?: string;
|
|
353
|
+
/**
|
|
354
|
+
* Tasks that should be done before this one (short ids), set with `block` / `removeBlock` on update. Just a flag, nothing is enforced. Only present when the task is blocked.
|
|
355
|
+
*/
|
|
356
|
+
blocked_by?: Array<string>;
|
|
348
357
|
children?: Array<string | Task>;
|
|
349
358
|
parents?: Array<string>;
|
|
350
359
|
};
|
|
@@ -547,6 +556,189 @@ declare class Tasks {
|
|
|
547
556
|
static updateTask<ThrowOnError extends boolean = false>(options: Options<UpdateTaskData, ThrowOnError>): RequestResult<UpdateTaskResponses, UpdateTaskErrors, ThrowOnError, "fields">;
|
|
548
557
|
}
|
|
549
558
|
|
|
559
|
+
declare const zTask: z.ZodMiniObject<{
|
|
560
|
+
id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
561
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
562
|
+
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
563
|
+
encrypted: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
564
|
+
deadline: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
565
|
+
deadline_date: z.ZodMiniOptional<z.iso.ZodMiniISODateTime>;
|
|
566
|
+
status: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
567
|
+
ACTIVE: "ACTIVE";
|
|
568
|
+
COMPLETED: "COMPLETED";
|
|
569
|
+
CANCELLED: "CANCELLED";
|
|
570
|
+
READY: "READY";
|
|
571
|
+
IN_PROGRESS: "IN_PROGRESS";
|
|
572
|
+
WAITING: "WAITING";
|
|
573
|
+
DELEGATED: "DELEGATED";
|
|
574
|
+
}>>;
|
|
575
|
+
completion: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
576
|
+
worked_time: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
577
|
+
priority: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniUnion<readonly [z.ZodMiniLiteral<1>, z.ZodMiniLiteral<2>, z.ZodMiniLiteral<3>]>>>;
|
|
578
|
+
created: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
579
|
+
blocked_by: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
580
|
+
children: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniLazy<any>]>>>;
|
|
581
|
+
parents: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
582
|
+
}, z.core.$strip>;
|
|
583
|
+
declare const zListTasksQuery: z.ZodMiniObject<{
|
|
584
|
+
includeEncrypted: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
585
|
+
tree: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
586
|
+
treeFull: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
587
|
+
showCreated: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
588
|
+
showCreatedDate: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
589
|
+
showCompleted: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
590
|
+
}, z.core.$strip>;
|
|
591
|
+
/**
|
|
592
|
+
* List of tasks
|
|
593
|
+
*/
|
|
594
|
+
declare const zListTasksResponse: z.ZodMiniArray<z.ZodMiniObject<{
|
|
595
|
+
id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
596
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
597
|
+
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
598
|
+
encrypted: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
599
|
+
deadline: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
600
|
+
deadline_date: z.ZodMiniOptional<z.iso.ZodMiniISODateTime>;
|
|
601
|
+
status: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
602
|
+
ACTIVE: "ACTIVE";
|
|
603
|
+
COMPLETED: "COMPLETED";
|
|
604
|
+
CANCELLED: "CANCELLED";
|
|
605
|
+
READY: "READY";
|
|
606
|
+
IN_PROGRESS: "IN_PROGRESS";
|
|
607
|
+
WAITING: "WAITING";
|
|
608
|
+
DELEGATED: "DELEGATED";
|
|
609
|
+
}>>;
|
|
610
|
+
completion: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
611
|
+
worked_time: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
612
|
+
priority: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniUnion<readonly [z.ZodMiniLiteral<1>, z.ZodMiniLiteral<2>, z.ZodMiniLiteral<3>]>>>;
|
|
613
|
+
created: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
614
|
+
blocked_by: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
615
|
+
children: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniLazy<any>]>>>;
|
|
616
|
+
parents: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
617
|
+
}, z.core.$strip>>;
|
|
618
|
+
declare const zCreateTaskBody: z.ZodMiniObject<{
|
|
619
|
+
title: z.ZodMiniString<string>;
|
|
620
|
+
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
621
|
+
priority: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniLiteral<0>, z.ZodMiniLiteral<1>, z.ZodMiniLiteral<2>, z.ZodMiniLiteral<3>]>>;
|
|
622
|
+
deadline: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
623
|
+
parent_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
624
|
+
}, z.core.$strip>;
|
|
625
|
+
/**
|
|
626
|
+
* Created
|
|
627
|
+
*/
|
|
628
|
+
declare const zCreateTaskResponse: z.ZodMiniObject<{
|
|
629
|
+
id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
630
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
631
|
+
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
632
|
+
encrypted: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
633
|
+
deadline: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
634
|
+
deadline_date: z.ZodMiniOptional<z.iso.ZodMiniISODateTime>;
|
|
635
|
+
status: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
636
|
+
ACTIVE: "ACTIVE";
|
|
637
|
+
COMPLETED: "COMPLETED";
|
|
638
|
+
CANCELLED: "CANCELLED";
|
|
639
|
+
READY: "READY";
|
|
640
|
+
IN_PROGRESS: "IN_PROGRESS";
|
|
641
|
+
WAITING: "WAITING";
|
|
642
|
+
DELEGATED: "DELEGATED";
|
|
643
|
+
}>>;
|
|
644
|
+
completion: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
645
|
+
worked_time: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
646
|
+
priority: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniUnion<readonly [z.ZodMiniLiteral<1>, z.ZodMiniLiteral<2>, z.ZodMiniLiteral<3>]>>>;
|
|
647
|
+
created: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
648
|
+
blocked_by: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
649
|
+
children: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniLazy<any>]>>>;
|
|
650
|
+
parents: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
651
|
+
}, z.core.$strip>;
|
|
652
|
+
declare const zGetTaskPath: z.ZodMiniObject<{
|
|
653
|
+
id: z.ZodMiniString<string>;
|
|
654
|
+
}, z.core.$strip>;
|
|
655
|
+
declare const zGetTaskQuery: z.ZodMiniObject<{
|
|
656
|
+
includeEncrypted: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
657
|
+
tree: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
658
|
+
treeFull: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
659
|
+
showCreated: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
660
|
+
showCreatedDate: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
661
|
+
showCompleted: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
662
|
+
}, z.core.$strip>;
|
|
663
|
+
/**
|
|
664
|
+
* A task
|
|
665
|
+
*/
|
|
666
|
+
declare const zGetTaskResponse: z.ZodMiniObject<{
|
|
667
|
+
id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
668
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
669
|
+
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
670
|
+
encrypted: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
671
|
+
deadline: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
672
|
+
deadline_date: z.ZodMiniOptional<z.iso.ZodMiniISODateTime>;
|
|
673
|
+
status: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
674
|
+
ACTIVE: "ACTIVE";
|
|
675
|
+
COMPLETED: "COMPLETED";
|
|
676
|
+
CANCELLED: "CANCELLED";
|
|
677
|
+
READY: "READY";
|
|
678
|
+
IN_PROGRESS: "IN_PROGRESS";
|
|
679
|
+
WAITING: "WAITING";
|
|
680
|
+
DELEGATED: "DELEGATED";
|
|
681
|
+
}>>;
|
|
682
|
+
completion: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
683
|
+
worked_time: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
684
|
+
priority: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniUnion<readonly [z.ZodMiniLiteral<1>, z.ZodMiniLiteral<2>, z.ZodMiniLiteral<3>]>>>;
|
|
685
|
+
created: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
686
|
+
blocked_by: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
687
|
+
children: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniLazy<any>]>>>;
|
|
688
|
+
parents: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
689
|
+
}, z.core.$strip>;
|
|
690
|
+
declare const zUpdateTaskBody: z.ZodMiniObject<{
|
|
691
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
692
|
+
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
693
|
+
deadline: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
694
|
+
status: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
695
|
+
ACTIVE: "ACTIVE";
|
|
696
|
+
COMPLETED: "COMPLETED";
|
|
697
|
+
CANCELLED: "CANCELLED";
|
|
698
|
+
READY: "READY";
|
|
699
|
+
IN_PROGRESS: "IN_PROGRESS";
|
|
700
|
+
WAITING: "WAITING";
|
|
701
|
+
DELEGATED: "DELEGATED";
|
|
702
|
+
}>>;
|
|
703
|
+
priority: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniLiteral<0>, z.ZodMiniLiteral<1>, z.ZodMiniLiteral<2>, z.ZodMiniLiteral<3>]>>;
|
|
704
|
+
add_parent: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
705
|
+
remove_parent: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
706
|
+
replace_parent: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
707
|
+
replace_parent_from: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
708
|
+
block: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
709
|
+
removeBlock: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
710
|
+
}, z.core.$strip>;
|
|
711
|
+
declare const zUpdateTaskPath: z.ZodMiniObject<{
|
|
712
|
+
id: z.ZodMiniString<string>;
|
|
713
|
+
}, z.core.$strip>;
|
|
714
|
+
/**
|
|
715
|
+
* Updated
|
|
716
|
+
*/
|
|
717
|
+
declare const zUpdateTaskResponse: z.ZodMiniObject<{
|
|
718
|
+
id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
719
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
720
|
+
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
721
|
+
encrypted: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
722
|
+
deadline: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
723
|
+
deadline_date: z.ZodMiniOptional<z.iso.ZodMiniISODateTime>;
|
|
724
|
+
status: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
725
|
+
ACTIVE: "ACTIVE";
|
|
726
|
+
COMPLETED: "COMPLETED";
|
|
727
|
+
CANCELLED: "CANCELLED";
|
|
728
|
+
READY: "READY";
|
|
729
|
+
IN_PROGRESS: "IN_PROGRESS";
|
|
730
|
+
WAITING: "WAITING";
|
|
731
|
+
DELEGATED: "DELEGATED";
|
|
732
|
+
}>>;
|
|
733
|
+
completion: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
734
|
+
worked_time: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
735
|
+
priority: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniUnion<readonly [z.ZodMiniLiteral<1>, z.ZodMiniLiteral<2>, z.ZodMiniLiteral<3>]>>>;
|
|
736
|
+
created: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
737
|
+
blocked_by: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
738
|
+
children: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniLazy<any>]>>>;
|
|
739
|
+
parents: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
740
|
+
}, z.core.$strip>;
|
|
741
|
+
|
|
550
742
|
interface PerspecTaskOptions {
|
|
551
743
|
/**
|
|
552
744
|
* Your PerspecTask API key (begins with `pt_live_`). Create one in the web
|
|
@@ -631,4 +823,4 @@ declare function createTasksNamespace(client: Client): {
|
|
|
631
823
|
}>;
|
|
632
824
|
};
|
|
633
825
|
|
|
634
|
-
export { type ClientOptions, type CreateTaskData, type CreateTaskResponse, type CreateTaskResponses, type GetTaskData, type GetTaskErrors, type GetTaskResponse, type GetTaskResponses, type ListTasksData, type ListTasksResponse, type ListTasksResponses, type Options, PerspecTask, type PerspecTaskOptions, type Task, Tasks, type UpdateTaskData, type UpdateTaskErrors, type UpdateTaskResponse, type UpdateTaskResponses, PerspecTask as default };
|
|
826
|
+
export { type ClientOptions, type CreateTaskData, type CreateTaskResponse, type CreateTaskResponses, type GetTaskData, type GetTaskErrors, type GetTaskResponse, type GetTaskResponses, type ListTasksData, type ListTasksResponse, type ListTasksResponses, type Options, PerspecTask, type PerspecTaskOptions, type Task, Tasks, type UpdateTaskData, type UpdateTaskErrors, type UpdateTaskResponse, type UpdateTaskResponses, PerspecTask as default, zCreateTaskBody, zCreateTaskResponse, zGetTaskPath, zGetTaskQuery, zGetTaskResponse, zListTasksQuery, zListTasksResponse, zTask, zUpdateTaskBody, zUpdateTaskPath, zUpdateTaskResponse };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import * as z from 'zod/mini';
|
|
2
|
+
|
|
1
3
|
type AuthToken = string | undefined;
|
|
2
4
|
interface Auth {
|
|
3
5
|
/**
|
|
@@ -316,6 +318,9 @@ type ClientOptions = {
|
|
|
316
318
|
baseUrl: 'https://api.perspectask.com/v1' | (string & {});
|
|
317
319
|
};
|
|
318
320
|
type Task = {
|
|
321
|
+
/**
|
|
322
|
+
* Short id: the minimum unique prefix of the task UUID (e.g. "a3f"). Accepted anywhere an id is.
|
|
323
|
+
*/
|
|
319
324
|
id?: string;
|
|
320
325
|
title?: string;
|
|
321
326
|
description?: string;
|
|
@@ -345,6 +350,10 @@ type Task = {
|
|
|
345
350
|
* When the task was created. Omitted by default. Present only when requested: `?showCreated=true` returns a relative time (e.g. "5 minutes ago"), `?showCreatedDate=true` returns an absolute ISO 8601 timestamp.
|
|
346
351
|
*/
|
|
347
352
|
created?: string;
|
|
353
|
+
/**
|
|
354
|
+
* Tasks that should be done before this one (short ids), set with `block` / `removeBlock` on update. Just a flag, nothing is enforced. Only present when the task is blocked.
|
|
355
|
+
*/
|
|
356
|
+
blocked_by?: Array<string>;
|
|
348
357
|
children?: Array<string | Task>;
|
|
349
358
|
parents?: Array<string>;
|
|
350
359
|
};
|
|
@@ -547,6 +556,189 @@ declare class Tasks {
|
|
|
547
556
|
static updateTask<ThrowOnError extends boolean = false>(options: Options<UpdateTaskData, ThrowOnError>): RequestResult<UpdateTaskResponses, UpdateTaskErrors, ThrowOnError, "fields">;
|
|
548
557
|
}
|
|
549
558
|
|
|
559
|
+
declare const zTask: z.ZodMiniObject<{
|
|
560
|
+
id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
561
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
562
|
+
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
563
|
+
encrypted: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
564
|
+
deadline: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
565
|
+
deadline_date: z.ZodMiniOptional<z.iso.ZodMiniISODateTime>;
|
|
566
|
+
status: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
567
|
+
ACTIVE: "ACTIVE";
|
|
568
|
+
COMPLETED: "COMPLETED";
|
|
569
|
+
CANCELLED: "CANCELLED";
|
|
570
|
+
READY: "READY";
|
|
571
|
+
IN_PROGRESS: "IN_PROGRESS";
|
|
572
|
+
WAITING: "WAITING";
|
|
573
|
+
DELEGATED: "DELEGATED";
|
|
574
|
+
}>>;
|
|
575
|
+
completion: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
576
|
+
worked_time: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
577
|
+
priority: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniUnion<readonly [z.ZodMiniLiteral<1>, z.ZodMiniLiteral<2>, z.ZodMiniLiteral<3>]>>>;
|
|
578
|
+
created: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
579
|
+
blocked_by: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
580
|
+
children: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniLazy<any>]>>>;
|
|
581
|
+
parents: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
582
|
+
}, z.core.$strip>;
|
|
583
|
+
declare const zListTasksQuery: z.ZodMiniObject<{
|
|
584
|
+
includeEncrypted: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
585
|
+
tree: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
586
|
+
treeFull: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
587
|
+
showCreated: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
588
|
+
showCreatedDate: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
589
|
+
showCompleted: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
590
|
+
}, z.core.$strip>;
|
|
591
|
+
/**
|
|
592
|
+
* List of tasks
|
|
593
|
+
*/
|
|
594
|
+
declare const zListTasksResponse: z.ZodMiniArray<z.ZodMiniObject<{
|
|
595
|
+
id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
596
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
597
|
+
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
598
|
+
encrypted: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
599
|
+
deadline: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
600
|
+
deadline_date: z.ZodMiniOptional<z.iso.ZodMiniISODateTime>;
|
|
601
|
+
status: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
602
|
+
ACTIVE: "ACTIVE";
|
|
603
|
+
COMPLETED: "COMPLETED";
|
|
604
|
+
CANCELLED: "CANCELLED";
|
|
605
|
+
READY: "READY";
|
|
606
|
+
IN_PROGRESS: "IN_PROGRESS";
|
|
607
|
+
WAITING: "WAITING";
|
|
608
|
+
DELEGATED: "DELEGATED";
|
|
609
|
+
}>>;
|
|
610
|
+
completion: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
611
|
+
worked_time: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
612
|
+
priority: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniUnion<readonly [z.ZodMiniLiteral<1>, z.ZodMiniLiteral<2>, z.ZodMiniLiteral<3>]>>>;
|
|
613
|
+
created: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
614
|
+
blocked_by: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
615
|
+
children: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniLazy<any>]>>>;
|
|
616
|
+
parents: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
617
|
+
}, z.core.$strip>>;
|
|
618
|
+
declare const zCreateTaskBody: z.ZodMiniObject<{
|
|
619
|
+
title: z.ZodMiniString<string>;
|
|
620
|
+
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
621
|
+
priority: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniLiteral<0>, z.ZodMiniLiteral<1>, z.ZodMiniLiteral<2>, z.ZodMiniLiteral<3>]>>;
|
|
622
|
+
deadline: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
623
|
+
parent_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
624
|
+
}, z.core.$strip>;
|
|
625
|
+
/**
|
|
626
|
+
* Created
|
|
627
|
+
*/
|
|
628
|
+
declare const zCreateTaskResponse: z.ZodMiniObject<{
|
|
629
|
+
id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
630
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
631
|
+
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
632
|
+
encrypted: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
633
|
+
deadline: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
634
|
+
deadline_date: z.ZodMiniOptional<z.iso.ZodMiniISODateTime>;
|
|
635
|
+
status: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
636
|
+
ACTIVE: "ACTIVE";
|
|
637
|
+
COMPLETED: "COMPLETED";
|
|
638
|
+
CANCELLED: "CANCELLED";
|
|
639
|
+
READY: "READY";
|
|
640
|
+
IN_PROGRESS: "IN_PROGRESS";
|
|
641
|
+
WAITING: "WAITING";
|
|
642
|
+
DELEGATED: "DELEGATED";
|
|
643
|
+
}>>;
|
|
644
|
+
completion: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
645
|
+
worked_time: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
646
|
+
priority: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniUnion<readonly [z.ZodMiniLiteral<1>, z.ZodMiniLiteral<2>, z.ZodMiniLiteral<3>]>>>;
|
|
647
|
+
created: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
648
|
+
blocked_by: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
649
|
+
children: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniLazy<any>]>>>;
|
|
650
|
+
parents: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
651
|
+
}, z.core.$strip>;
|
|
652
|
+
declare const zGetTaskPath: z.ZodMiniObject<{
|
|
653
|
+
id: z.ZodMiniString<string>;
|
|
654
|
+
}, z.core.$strip>;
|
|
655
|
+
declare const zGetTaskQuery: z.ZodMiniObject<{
|
|
656
|
+
includeEncrypted: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
657
|
+
tree: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
658
|
+
treeFull: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
659
|
+
showCreated: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
660
|
+
showCreatedDate: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
661
|
+
showCompleted: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
662
|
+
}, z.core.$strip>;
|
|
663
|
+
/**
|
|
664
|
+
* A task
|
|
665
|
+
*/
|
|
666
|
+
declare const zGetTaskResponse: z.ZodMiniObject<{
|
|
667
|
+
id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
668
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
669
|
+
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
670
|
+
encrypted: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
671
|
+
deadline: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
672
|
+
deadline_date: z.ZodMiniOptional<z.iso.ZodMiniISODateTime>;
|
|
673
|
+
status: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
674
|
+
ACTIVE: "ACTIVE";
|
|
675
|
+
COMPLETED: "COMPLETED";
|
|
676
|
+
CANCELLED: "CANCELLED";
|
|
677
|
+
READY: "READY";
|
|
678
|
+
IN_PROGRESS: "IN_PROGRESS";
|
|
679
|
+
WAITING: "WAITING";
|
|
680
|
+
DELEGATED: "DELEGATED";
|
|
681
|
+
}>>;
|
|
682
|
+
completion: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
683
|
+
worked_time: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
684
|
+
priority: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniUnion<readonly [z.ZodMiniLiteral<1>, z.ZodMiniLiteral<2>, z.ZodMiniLiteral<3>]>>>;
|
|
685
|
+
created: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
686
|
+
blocked_by: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
687
|
+
children: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniLazy<any>]>>>;
|
|
688
|
+
parents: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
689
|
+
}, z.core.$strip>;
|
|
690
|
+
declare const zUpdateTaskBody: z.ZodMiniObject<{
|
|
691
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
692
|
+
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
693
|
+
deadline: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
694
|
+
status: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
695
|
+
ACTIVE: "ACTIVE";
|
|
696
|
+
COMPLETED: "COMPLETED";
|
|
697
|
+
CANCELLED: "CANCELLED";
|
|
698
|
+
READY: "READY";
|
|
699
|
+
IN_PROGRESS: "IN_PROGRESS";
|
|
700
|
+
WAITING: "WAITING";
|
|
701
|
+
DELEGATED: "DELEGATED";
|
|
702
|
+
}>>;
|
|
703
|
+
priority: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniLiteral<0>, z.ZodMiniLiteral<1>, z.ZodMiniLiteral<2>, z.ZodMiniLiteral<3>]>>;
|
|
704
|
+
add_parent: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
705
|
+
remove_parent: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
706
|
+
replace_parent: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
707
|
+
replace_parent_from: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
708
|
+
block: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
709
|
+
removeBlock: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
710
|
+
}, z.core.$strip>;
|
|
711
|
+
declare const zUpdateTaskPath: z.ZodMiniObject<{
|
|
712
|
+
id: z.ZodMiniString<string>;
|
|
713
|
+
}, z.core.$strip>;
|
|
714
|
+
/**
|
|
715
|
+
* Updated
|
|
716
|
+
*/
|
|
717
|
+
declare const zUpdateTaskResponse: z.ZodMiniObject<{
|
|
718
|
+
id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
719
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
720
|
+
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
721
|
+
encrypted: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
722
|
+
deadline: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
723
|
+
deadline_date: z.ZodMiniOptional<z.iso.ZodMiniISODateTime>;
|
|
724
|
+
status: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
725
|
+
ACTIVE: "ACTIVE";
|
|
726
|
+
COMPLETED: "COMPLETED";
|
|
727
|
+
CANCELLED: "CANCELLED";
|
|
728
|
+
READY: "READY";
|
|
729
|
+
IN_PROGRESS: "IN_PROGRESS";
|
|
730
|
+
WAITING: "WAITING";
|
|
731
|
+
DELEGATED: "DELEGATED";
|
|
732
|
+
}>>;
|
|
733
|
+
completion: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
734
|
+
worked_time: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
735
|
+
priority: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniUnion<readonly [z.ZodMiniLiteral<1>, z.ZodMiniLiteral<2>, z.ZodMiniLiteral<3>]>>>;
|
|
736
|
+
created: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
737
|
+
blocked_by: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
738
|
+
children: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniLazy<any>]>>>;
|
|
739
|
+
parents: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
740
|
+
}, z.core.$strip>;
|
|
741
|
+
|
|
550
742
|
interface PerspecTaskOptions {
|
|
551
743
|
/**
|
|
552
744
|
* Your PerspecTask API key (begins with `pt_live_`). Create one in the web
|
|
@@ -631,4 +823,4 @@ declare function createTasksNamespace(client: Client): {
|
|
|
631
823
|
}>;
|
|
632
824
|
};
|
|
633
825
|
|
|
634
|
-
export { type ClientOptions, type CreateTaskData, type CreateTaskResponse, type CreateTaskResponses, type GetTaskData, type GetTaskErrors, type GetTaskResponse, type GetTaskResponses, type ListTasksData, type ListTasksResponse, type ListTasksResponses, type Options, PerspecTask, type PerspecTaskOptions, type Task, Tasks, type UpdateTaskData, type UpdateTaskErrors, type UpdateTaskResponse, type UpdateTaskResponses, PerspecTask as default };
|
|
826
|
+
export { type ClientOptions, type CreateTaskData, type CreateTaskResponse, type CreateTaskResponses, type GetTaskData, type GetTaskErrors, type GetTaskResponse, type GetTaskResponses, type ListTasksData, type ListTasksResponse, type ListTasksResponses, type Options, PerspecTask, type PerspecTaskOptions, type Task, Tasks, type UpdateTaskData, type UpdateTaskErrors, type UpdateTaskResponse, type UpdateTaskResponses, PerspecTask as default, zCreateTaskBody, zCreateTaskResponse, zGetTaskPath, zGetTaskQuery, zGetTaskResponse, zListTasksQuery, zListTasksResponse, zTask, zUpdateTaskBody, zUpdateTaskPath, zUpdateTaskResponse };
|
package/dist/index.js
CHANGED
|
@@ -838,6 +838,161 @@ var Tasks = class {
|
|
|
838
838
|
}
|
|
839
839
|
};
|
|
840
840
|
|
|
841
|
+
// src/generated/zod.gen.ts
|
|
842
|
+
import * as z from "zod/mini";
|
|
843
|
+
var zTask = z.object({
|
|
844
|
+
id: z.optional(z.string().check(z.regex(/^[0-9a-fA-F]{3,32}$|^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/)).register(z.globalRegistry, {
|
|
845
|
+
description: 'Short id: the minimum unique prefix of the task UUID (e.g. "a3f"). Accepted anywhere an id is.'
|
|
846
|
+
})),
|
|
847
|
+
title: z.optional(z.string()),
|
|
848
|
+
description: z.optional(z.string()),
|
|
849
|
+
encrypted: z.optional(z.boolean().register(z.globalRegistry, {
|
|
850
|
+
description: "True for end-to-end-encrypted tasks. Their title and description are omitted over this API (the keys are absent, not empty) \u2014 decrypt them in the web app."
|
|
851
|
+
})),
|
|
852
|
+
deadline: z.optional(z.string().register(z.globalRegistry, {
|
|
853
|
+
description: `The task's column id \u2014 d-20-11-2026, w-23-2026, m-6-2026, q-2-2026, y-2026, or "l" (lifetime). This is the same canonical form accepted as input on create/update.`
|
|
854
|
+
})),
|
|
855
|
+
deadline_date: z.optional(z.iso.datetime().register(z.globalRegistry, {
|
|
856
|
+
description: "The actual end-of-period timestamp (e.g. Sunday 23:59:59 for a weekly task). Omitted for lifetime tasks and tasks without a schedule."
|
|
857
|
+
})),
|
|
858
|
+
status: z.optional(z.enum([
|
|
859
|
+
"ACTIVE",
|
|
860
|
+
"COMPLETED",
|
|
861
|
+
"CANCELLED",
|
|
862
|
+
"READY",
|
|
863
|
+
"IN_PROGRESS",
|
|
864
|
+
"WAITING",
|
|
865
|
+
"DELEGATED"
|
|
866
|
+
])),
|
|
867
|
+
completion: z.optional(z.string().register(z.globalRegistry, {
|
|
868
|
+
description: 'Percentage complete (e.g. "52%"), computed recursively over the ENTIRE subtree \u2014 children, their children, and so on to the leaves \u2014 not just direct children. PerspecTask maintains this automatically so the user sees true progress at a glance. It can read 100% when every descendant is completed even if this task itself is not yet checked. Conversely, if this task is itself marked completed, its completion is forced to 100% regardless of any unfinished descendants (the task-level status overrides the rollup). Only present when the task has children.'
|
|
869
|
+
})),
|
|
870
|
+
worked_time: z.optional(z.number().register(z.globalRegistry, {
|
|
871
|
+
description: "Total time tracked on this task, in seconds, summed across all its timers. Only present when greater than 0."
|
|
872
|
+
})),
|
|
873
|
+
priority: z.nullish(z.union([
|
|
874
|
+
z.literal(1),
|
|
875
|
+
z.literal(2),
|
|
876
|
+
z.literal(3)
|
|
877
|
+
])),
|
|
878
|
+
created: z.optional(z.string().register(z.globalRegistry, {
|
|
879
|
+
description: 'When the task was created. Omitted by default. Present only when requested: `?showCreated=true` returns a relative time (e.g. "5 minutes ago"), `?showCreatedDate=true` returns an absolute ISO 8601 timestamp.'
|
|
880
|
+
})),
|
|
881
|
+
blocked_by: z.optional(z.array(z.string().check(z.regex(/^[0-9a-fA-F]{3,32}$|^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/))).register(z.globalRegistry, {
|
|
882
|
+
description: "Tasks that should be done before this one (short ids), set with `block` / `removeBlock` on update. Just a flag, nothing is enforced. Only present when the task is blocked."
|
|
883
|
+
})),
|
|
884
|
+
children: z.optional(z.array(z.union([z.string().check(z.regex(/^[0-9a-fA-F]{3,32}$|^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/)), z.lazy(() => zTask)]))),
|
|
885
|
+
parents: z.optional(z.array(z.string().check(z.regex(/^[0-9a-fA-F]{3,32}$|^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/))))
|
|
886
|
+
});
|
|
887
|
+
var zListTasksQuery = z.object({
|
|
888
|
+
includeEncrypted: z.optional(z.boolean().register(z.globalRegistry, {
|
|
889
|
+
description: "Defaults to false. In tree mode, encrypted tasks are pruned UNLESS they lie on the path to an unencrypted task \u2014 so an encrypted parent of a readable task is kept (with `encrypted: true` and no title/description keys) to preserve structure, while fully-encrypted branches are hidden. In flat mode, encrypted tasks are simply omitted. Set to true to include ALL end-to-end-encrypted tasks for full visibility."
|
|
890
|
+
})),
|
|
891
|
+
tree: z.optional(z.boolean().register(z.globalRegistry, {
|
|
892
|
+
description: "Defaults to false. When true, each task's `children` are returned as full nested task objects (recursively) instead of id strings. A task that was already expanded elsewhere in the tree will not be expanded again \u2014 only its short id string will appear in the `children` array of subsequent parent tasks, preserving the relationship without repeating the full object."
|
|
893
|
+
})),
|
|
894
|
+
treeFull: z.optional(z.boolean().register(z.globalRegistry, {
|
|
895
|
+
description: "Like `tree` but without deduplication: a task with multiple parents appears under each parent. Mutually exclusive with `tree`."
|
|
896
|
+
})),
|
|
897
|
+
showCreated: z.optional(z.boolean().register(z.globalRegistry, {
|
|
898
|
+
description: 'Defaults to false. Set to true to include `created` as a human-friendly relative time (e.g. "5 minutes ago"). Ignored when `showCreatedDate` is true.'
|
|
899
|
+
})),
|
|
900
|
+
showCreatedDate: z.optional(z.boolean().register(z.globalRegistry, {
|
|
901
|
+
description: "Defaults to false. Set to true to include `created` as an absolute ISO 8601 timestamp. Takes precedence over `showCreated` when both are set."
|
|
902
|
+
})),
|
|
903
|
+
showCompleted: z.optional(z.boolean().register(z.globalRegistry, {
|
|
904
|
+
description: "Defaults to false. By default the list omits done tasks (status COMPLETED and CANCELLED) so an agent sees only open work and to save context. Set to true to include all completed and cancelled tasks. Exception in tree mode: a completed task is kept if any of its descendants is still open \u2014 this preserves the path/context to that open task even when showCompleted is false."
|
|
905
|
+
}))
|
|
906
|
+
});
|
|
907
|
+
var zListTasksResponse = z.array(zTask).register(z.globalRegistry, {
|
|
908
|
+
description: "List of tasks"
|
|
909
|
+
});
|
|
910
|
+
var zCreateTaskBody = z.object({
|
|
911
|
+
title: z.string().check(z.minLength(1)),
|
|
912
|
+
description: z.optional(z.string()),
|
|
913
|
+
priority: z.optional(z.union([
|
|
914
|
+
z.literal(0),
|
|
915
|
+
z.literal(1),
|
|
916
|
+
z.literal(2),
|
|
917
|
+
z.literal(3)
|
|
918
|
+
])),
|
|
919
|
+
deadline: z.optional(z.string().register(z.globalRegistry, {
|
|
920
|
+
description: "When this task is due. A single shorthand token that sets both the period type and the date. Accepts: today, tomorrow, this/next week|month|quarter|year, lifetime, the bare letters d/w/m/q/y/l (= today, this week, this month, this quarter, this year, lifetime), or a column id (d-20-11-2026, w-23-2026, m-6-2026, q-2-2026, y-2026; trailing parts may be omitted to default to current month/year; the first number may be glued: q2, w23, d20)."
|
|
921
|
+
})),
|
|
922
|
+
parent_id: z.optional(z.string().check(z.regex(/^[0-9a-fA-F]{3,32}$|^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/)).register(z.globalRegistry, {
|
|
923
|
+
description: "Parent task id \u2014 full UUID or a short id prefix."
|
|
924
|
+
}))
|
|
925
|
+
});
|
|
926
|
+
var zCreateTaskResponse = zTask;
|
|
927
|
+
var zGetTaskPath = z.object({
|
|
928
|
+
id: z.string().check(z.regex(/^[0-9a-fA-F]{3,32}$|^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/))
|
|
929
|
+
});
|
|
930
|
+
var zGetTaskQuery = z.object({
|
|
931
|
+
includeEncrypted: z.optional(z.boolean().register(z.globalRegistry, {
|
|
932
|
+
description: "Defaults to false. In tree mode, encrypted descendants are pruned unless they lie on the path to an unencrypted task (so you see the structure leading to a task you can read). Set to true to keep ALL encrypted tasks in the subtree (returned with `encrypted: true` and no title/description keys). The requested task itself is always returned regardless."
|
|
933
|
+
})),
|
|
934
|
+
tree: z.optional(z.boolean().register(z.globalRegistry, {
|
|
935
|
+
description: "Defaults to false. When true, this task's `children` are returned as full nested task objects (recursively) instead of id strings. A task that was already expanded elsewhere in the subtree will not be expanded again \u2014 only its short id string will appear in subsequent parents' `children`, preserving the relationship without repeating the full object."
|
|
936
|
+
})),
|
|
937
|
+
treeFull: z.optional(z.boolean().register(z.globalRegistry, {
|
|
938
|
+
description: "Like `tree` but without deduplication: a task with multiple parents appears under each parent. Mutually exclusive with `tree`."
|
|
939
|
+
})),
|
|
940
|
+
showCreated: z.optional(z.boolean().register(z.globalRegistry, {
|
|
941
|
+
description: 'Defaults to false. Set to true to include `created` as a human-friendly relative time (e.g. "5 minutes ago"). Ignored when `showCreatedDate` is true.'
|
|
942
|
+
})),
|
|
943
|
+
showCreatedDate: z.optional(z.boolean().register(z.globalRegistry, {
|
|
944
|
+
description: "Defaults to false. Set to true to include `created` as an absolute ISO 8601 timestamp. Takes precedence over `showCreated` when both are set."
|
|
945
|
+
})),
|
|
946
|
+
showCompleted: z.optional(z.boolean().register(z.globalRegistry, {
|
|
947
|
+
description: "Defaults to false. By default completed and cancelled subtasks are pruned from the tree. Exception: a completed task is kept if any of its descendants is still open (to preserve context/path). Set to true to include all completed and cancelled tasks regardless."
|
|
948
|
+
}))
|
|
949
|
+
});
|
|
950
|
+
var zGetTaskResponse = zTask;
|
|
951
|
+
var zUpdateTaskBody = z.object({
|
|
952
|
+
title: z.optional(z.string()),
|
|
953
|
+
description: z.optional(z.string()),
|
|
954
|
+
deadline: z.optional(z.string().register(z.globalRegistry, {
|
|
955
|
+
description: "When this task is due \u2014 same shorthand grammar as on create (today, lifetime, q-2-2026, q2, d-20-11, \u2026)."
|
|
956
|
+
})),
|
|
957
|
+
status: z.optional(z.enum([
|
|
958
|
+
"ACTIVE",
|
|
959
|
+
"COMPLETED",
|
|
960
|
+
"CANCELLED",
|
|
961
|
+
"READY",
|
|
962
|
+
"IN_PROGRESS",
|
|
963
|
+
"WAITING",
|
|
964
|
+
"DELEGATED"
|
|
965
|
+
])),
|
|
966
|
+
priority: z.optional(z.union([
|
|
967
|
+
z.literal(0),
|
|
968
|
+
z.literal(1),
|
|
969
|
+
z.literal(2),
|
|
970
|
+
z.literal(3)
|
|
971
|
+
])),
|
|
972
|
+
add_parent: z.optional(z.string().check(z.regex(/^[0-9a-fA-F]{3,32}$|^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/)).register(z.globalRegistry, {
|
|
973
|
+
description: "Attach this task as a child of the given parent (full UUID or short id prefix)."
|
|
974
|
+
})),
|
|
975
|
+
remove_parent: z.optional(z.string().check(z.regex(/^[0-9a-fA-F]{3,32}$|^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/)).register(z.globalRegistry, {
|
|
976
|
+
description: "Detach this task from the given parent (full UUID or short id prefix)."
|
|
977
|
+
})),
|
|
978
|
+
replace_parent: z.optional(z.string().check(z.regex(/^[0-9a-fA-F]{3,32}$|^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/)).register(z.globalRegistry, {
|
|
979
|
+
description: "Replace the task's existing parent with this new one (full UUID or short id prefix). If the task has exactly one parent, that one is replaced. If it has multiple, you must also pass `replace_parent_from` to say which to replace."
|
|
980
|
+
})),
|
|
981
|
+
replace_parent_from: z.optional(z.string().check(z.regex(/^[0-9a-fA-F]{3,32}$|^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/)).register(z.globalRegistry, {
|
|
982
|
+
description: "When replacing among multiple parents, the existing parent to replace (full UUID or short id prefix; used with `replace_parent`)."
|
|
983
|
+
})),
|
|
984
|
+
block: z.optional(z.string().check(z.regex(/^[0-9a-fA-F]{3,32}$|^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/)).register(z.globalRegistry, {
|
|
985
|
+
description: "Mark the given task as blocking this one \u2014 it should be done first (full UUID or short id prefix). Just a flag; nothing is enforced."
|
|
986
|
+
})),
|
|
987
|
+
removeBlock: z.optional(z.string().check(z.regex(/^[0-9a-fA-F]{3,32}$|^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/)).register(z.globalRegistry, {
|
|
988
|
+
description: 'Remove the given task from this task\u2019s "blocked by" list (full UUID or short id prefix).'
|
|
989
|
+
}))
|
|
990
|
+
});
|
|
991
|
+
var zUpdateTaskPath = z.object({
|
|
992
|
+
id: z.string().check(z.regex(/^[0-9a-fA-F]{3,32}$|^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/))
|
|
993
|
+
});
|
|
994
|
+
var zUpdateTaskResponse = zTask;
|
|
995
|
+
|
|
841
996
|
// src/index.ts
|
|
842
997
|
var PerspecTask = class {
|
|
843
998
|
/**
|
|
@@ -873,6 +1028,17 @@ var index_default = PerspecTask;
|
|
|
873
1028
|
export {
|
|
874
1029
|
PerspecTask,
|
|
875
1030
|
Tasks,
|
|
876
|
-
index_default as default
|
|
1031
|
+
index_default as default,
|
|
1032
|
+
zCreateTaskBody,
|
|
1033
|
+
zCreateTaskResponse,
|
|
1034
|
+
zGetTaskPath,
|
|
1035
|
+
zGetTaskQuery,
|
|
1036
|
+
zGetTaskResponse,
|
|
1037
|
+
zListTasksQuery,
|
|
1038
|
+
zListTasksResponse,
|
|
1039
|
+
zTask,
|
|
1040
|
+
zUpdateTaskBody,
|
|
1041
|
+
zUpdateTaskPath,
|
|
1042
|
+
zUpdateTaskResponse
|
|
877
1043
|
};
|
|
878
1044
|
//# sourceMappingURL=index.js.map
|