@perspectask/sdk 0.0.4 → 0.0.6

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
@@ -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,7 +318,14 @@ 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;
325
+ /**
326
+ * Put this code (e.g. "pt-a3f91c2") in a GitHub pull request title or branch name and the PR links itself to this task (needs the PerspecTask GitHub app on the repo). It is longer than the short id on purpose, so it stays unambiguous as more tasks are added. Returned on single-task responses (get, create, update), not on lists.
327
+ */
328
+ pr_token?: string;
320
329
  title?: string;
321
330
  description?: string;
322
331
  /**
@@ -345,9 +354,47 @@ type Task = {
345
354
  * 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
355
  */
347
356
  created?: string;
357
+ /**
358
+ * 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.
359
+ */
360
+ blocked_by?: Array<string>;
348
361
  children?: Array<string | Task>;
349
362
  parents?: Array<string>;
350
363
  };
364
+ type PullRequest = {
365
+ /**
366
+ * Id of this task↔PR link. Pass it to unlink.
367
+ */
368
+ id: string;
369
+ repo: string;
370
+ number: number;
371
+ title: string;
372
+ /**
373
+ * The PR on github.com.
374
+ */
375
+ url: string;
376
+ state: 'open' | 'closed' | 'merged';
377
+ /**
378
+ * Only present when the PR is a draft.
379
+ */
380
+ draft?: true;
381
+ /**
382
+ * Combined CI result of the PR's head commit (check runs + commit statuses). Omitted when the commit has no CI.
383
+ */
384
+ checks?: 'pending' | 'success' | 'failure';
385
+ /**
386
+ * Reviewers' current decision. Omitted when nobody approved or requested changes.
387
+ */
388
+ review?: 'approved' | 'changes_requested';
389
+ /**
390
+ * Latest successful preview deployment (Vercel, Netlify, …). Omitted when there is none.
391
+ */
392
+ preview_url?: string;
393
+ /**
394
+ * `auto` = linked by the pt- code in the PR; `manual` = linked by URL.
395
+ */
396
+ linked_by: 'auto' | 'manual';
397
+ };
351
398
  type ListTasksData = {
352
399
  body?: never;
353
400
  path?: never;
@@ -514,6 +561,90 @@ type UpdateTaskResponses = {
514
561
  200: Task;
515
562
  };
516
563
  type UpdateTaskResponse = UpdateTaskResponses[keyof UpdateTaskResponses];
564
+ type ListTaskPullRequestsData = {
565
+ body?: never;
566
+ path: {
567
+ id: string;
568
+ };
569
+ query?: never;
570
+ url: '/tasks/{id}/pull-requests';
571
+ };
572
+ type ListTaskPullRequestsErrors = {
573
+ /**
574
+ * Task not found
575
+ */
576
+ 404: unknown;
577
+ };
578
+ type ListTaskPullRequestsResponses = {
579
+ /**
580
+ * Linked pull requests (oldest first)
581
+ */
582
+ 200: Array<PullRequest>;
583
+ };
584
+ type ListTaskPullRequestsResponse = ListTaskPullRequestsResponses[keyof ListTaskPullRequestsResponses];
585
+ type LinkTaskPullRequestData = {
586
+ body: {
587
+ /**
588
+ * The pull request: `https://github.com/owner/repo/pull/123` or `owner/repo#123`.
589
+ */
590
+ url: string;
591
+ };
592
+ path: {
593
+ id: string;
594
+ };
595
+ query?: never;
596
+ url: '/tasks/{id}/pull-requests';
597
+ };
598
+ type LinkTaskPullRequestErrors = {
599
+ /**
600
+ * Not a GitHub pull request URL
601
+ */
602
+ 400: unknown;
603
+ /**
604
+ * Task is encrypted
605
+ */
606
+ 403: unknown;
607
+ /**
608
+ * Task, repository access, or pull request not found
609
+ */
610
+ 404: unknown;
611
+ };
612
+ type LinkTaskPullRequestResponses = {
613
+ /**
614
+ * Linked
615
+ */
616
+ 201: PullRequest;
617
+ };
618
+ type LinkTaskPullRequestResponse = LinkTaskPullRequestResponses[keyof LinkTaskPullRequestResponses];
619
+ type UnlinkTaskPullRequestData = {
620
+ body?: never;
621
+ path: {
622
+ id: string;
623
+ /**
624
+ * The link id (`id` from the pull request list).
625
+ */
626
+ prId: string;
627
+ };
628
+ query?: never;
629
+ url: '/tasks/{id}/pull-requests/{prId}';
630
+ };
631
+ type UnlinkTaskPullRequestErrors = {
632
+ /**
633
+ * Task is encrypted
634
+ */
635
+ 403: unknown;
636
+ /**
637
+ * Task or link not found
638
+ */
639
+ 404: unknown;
640
+ };
641
+ type UnlinkTaskPullRequestResponses = {
642
+ /**
643
+ * Unlinked
644
+ */
645
+ 204: void;
646
+ };
647
+ type UnlinkTaskPullRequestResponse = UnlinkTaskPullRequestResponses[keyof UnlinkTaskPullRequestResponses];
517
648
 
518
649
  type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options$1<TData, ThrowOnError, TResponse> & {
519
650
  /**
@@ -546,6 +677,318 @@ declare class Tasks {
546
677
  */
547
678
  static updateTask<ThrowOnError extends boolean = false>(options: Options<UpdateTaskData, ThrowOnError>): RequestResult<UpdateTaskResponses, UpdateTaskErrors, ThrowOnError, "fields">;
548
679
  }
680
+ declare class PullRequests {
681
+ /**
682
+ * List pull requests linked to a task
683
+ *
684
+ * The GitHub pull requests linked to this task, with their state, CI result, review decision and preview deploy, kept up to date by GitHub webhooks. Needs the PerspecTask GitHub app installed on the repository (Account → GitHub in the web app).
685
+ */
686
+ static listTaskPullRequests<ThrowOnError extends boolean = false>(options: Options<ListTaskPullRequestsData, ThrowOnError>): RequestResult<ListTaskPullRequestsResponses, ListTaskPullRequestsErrors, ThrowOnError, "fields">;
687
+ /**
688
+ * Link a pull request to a task
689
+ *
690
+ * Link a PR by its URL. Usually unnecessary: a PR whose title, branch or description contains the task's `pr_token` links itself. Linking an already-linked PR refreshes it. Needs the PerspecTask GitHub app installed on the repository (Account → GitHub in the web app). Answers 404 with `code: "not_installed"` when the app isn't on that repository or your GitHub account can't read it.
691
+ */
692
+ static linkTaskPullRequest<ThrowOnError extends boolean = false>(options: Options<LinkTaskPullRequestData, ThrowOnError>): RequestResult<LinkTaskPullRequestResponses, LinkTaskPullRequestErrors, ThrowOnError, "fields">;
693
+ /**
694
+ * Unlink a pull request from a task
695
+ *
696
+ * Remove a link (`prId` is the `id` from the list). It stays unlinked: later pushes to the PR do not link it again, only linking it by URL does.
697
+ */
698
+ static unlinkTaskPullRequest<ThrowOnError extends boolean = false>(options: Options<UnlinkTaskPullRequestData, ThrowOnError>): RequestResult<UnlinkTaskPullRequestResponses, UnlinkTaskPullRequestErrors, ThrowOnError, "fields">;
699
+ }
700
+
701
+ declare const zTask: z.ZodMiniObject<{
702
+ id: z.ZodMiniOptional<z.ZodMiniString<string>>;
703
+ pr_token: z.ZodMiniOptional<z.ZodMiniString<string>>;
704
+ title: z.ZodMiniOptional<z.ZodMiniString<string>>;
705
+ description: z.ZodMiniOptional<z.ZodMiniString<string>>;
706
+ encrypted: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
707
+ deadline: z.ZodMiniOptional<z.ZodMiniString<string>>;
708
+ deadline_date: z.ZodMiniOptional<z.iso.ZodMiniISODateTime>;
709
+ status: z.ZodMiniOptional<z.ZodMiniEnum<{
710
+ ACTIVE: "ACTIVE";
711
+ COMPLETED: "COMPLETED";
712
+ CANCELLED: "CANCELLED";
713
+ READY: "READY";
714
+ IN_PROGRESS: "IN_PROGRESS";
715
+ WAITING: "WAITING";
716
+ DELEGATED: "DELEGATED";
717
+ }>>;
718
+ completion: z.ZodMiniOptional<z.ZodMiniString<string>>;
719
+ worked_time: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
720
+ priority: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniUnion<readonly [z.ZodMiniLiteral<1>, z.ZodMiniLiteral<2>, z.ZodMiniLiteral<3>]>>>;
721
+ created: z.ZodMiniOptional<z.ZodMiniString<string>>;
722
+ blocked_by: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
723
+ children: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniLazy<any>]>>>;
724
+ parents: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
725
+ }, z.core.$strip>;
726
+ declare const zPullRequest: z.ZodMiniObject<{
727
+ id: z.ZodMiniUUID;
728
+ repo: z.ZodMiniString<string>;
729
+ number: z.ZodMiniNumberFormat;
730
+ title: z.ZodMiniString<string>;
731
+ url: z.ZodMiniString<string>;
732
+ state: z.ZodMiniEnum<{
733
+ open: "open";
734
+ closed: "closed";
735
+ merged: "merged";
736
+ }>;
737
+ draft: z.ZodMiniOptional<z.ZodMiniLiteral<true>>;
738
+ checks: z.ZodMiniOptional<z.ZodMiniEnum<{
739
+ pending: "pending";
740
+ success: "success";
741
+ failure: "failure";
742
+ }>>;
743
+ review: z.ZodMiniOptional<z.ZodMiniEnum<{
744
+ approved: "approved";
745
+ changes_requested: "changes_requested";
746
+ }>>;
747
+ preview_url: z.ZodMiniOptional<z.ZodMiniString<string>>;
748
+ linked_by: z.ZodMiniEnum<{
749
+ auto: "auto";
750
+ manual: "manual";
751
+ }>;
752
+ }, z.core.$strip>;
753
+ declare const zListTasksQuery: z.ZodMiniObject<{
754
+ includeEncrypted: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
755
+ tree: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
756
+ treeFull: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
757
+ showCreated: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
758
+ showCreatedDate: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
759
+ showCompleted: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
760
+ }, z.core.$strip>;
761
+ /**
762
+ * List of tasks
763
+ */
764
+ declare const zListTasksResponse: z.ZodMiniArray<z.ZodMiniObject<{
765
+ id: z.ZodMiniOptional<z.ZodMiniString<string>>;
766
+ pr_token: z.ZodMiniOptional<z.ZodMiniString<string>>;
767
+ title: z.ZodMiniOptional<z.ZodMiniString<string>>;
768
+ description: z.ZodMiniOptional<z.ZodMiniString<string>>;
769
+ encrypted: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
770
+ deadline: z.ZodMiniOptional<z.ZodMiniString<string>>;
771
+ deadline_date: z.ZodMiniOptional<z.iso.ZodMiniISODateTime>;
772
+ status: z.ZodMiniOptional<z.ZodMiniEnum<{
773
+ ACTIVE: "ACTIVE";
774
+ COMPLETED: "COMPLETED";
775
+ CANCELLED: "CANCELLED";
776
+ READY: "READY";
777
+ IN_PROGRESS: "IN_PROGRESS";
778
+ WAITING: "WAITING";
779
+ DELEGATED: "DELEGATED";
780
+ }>>;
781
+ completion: z.ZodMiniOptional<z.ZodMiniString<string>>;
782
+ worked_time: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
783
+ priority: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniUnion<readonly [z.ZodMiniLiteral<1>, z.ZodMiniLiteral<2>, z.ZodMiniLiteral<3>]>>>;
784
+ created: z.ZodMiniOptional<z.ZodMiniString<string>>;
785
+ blocked_by: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
786
+ children: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniLazy<any>]>>>;
787
+ parents: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
788
+ }, z.core.$strip>>;
789
+ declare const zCreateTaskBody: z.ZodMiniObject<{
790
+ title: z.ZodMiniString<string>;
791
+ description: z.ZodMiniOptional<z.ZodMiniString<string>>;
792
+ priority: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniLiteral<0>, z.ZodMiniLiteral<1>, z.ZodMiniLiteral<2>, z.ZodMiniLiteral<3>]>>;
793
+ deadline: z.ZodMiniOptional<z.ZodMiniString<string>>;
794
+ parent_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
795
+ }, z.core.$strip>;
796
+ /**
797
+ * Created
798
+ */
799
+ declare const zCreateTaskResponse: z.ZodMiniObject<{
800
+ id: z.ZodMiniOptional<z.ZodMiniString<string>>;
801
+ pr_token: z.ZodMiniOptional<z.ZodMiniString<string>>;
802
+ title: z.ZodMiniOptional<z.ZodMiniString<string>>;
803
+ description: z.ZodMiniOptional<z.ZodMiniString<string>>;
804
+ encrypted: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
805
+ deadline: z.ZodMiniOptional<z.ZodMiniString<string>>;
806
+ deadline_date: z.ZodMiniOptional<z.iso.ZodMiniISODateTime>;
807
+ status: z.ZodMiniOptional<z.ZodMiniEnum<{
808
+ ACTIVE: "ACTIVE";
809
+ COMPLETED: "COMPLETED";
810
+ CANCELLED: "CANCELLED";
811
+ READY: "READY";
812
+ IN_PROGRESS: "IN_PROGRESS";
813
+ WAITING: "WAITING";
814
+ DELEGATED: "DELEGATED";
815
+ }>>;
816
+ completion: z.ZodMiniOptional<z.ZodMiniString<string>>;
817
+ worked_time: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
818
+ priority: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniUnion<readonly [z.ZodMiniLiteral<1>, z.ZodMiniLiteral<2>, z.ZodMiniLiteral<3>]>>>;
819
+ created: z.ZodMiniOptional<z.ZodMiniString<string>>;
820
+ blocked_by: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
821
+ children: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniLazy<any>]>>>;
822
+ parents: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
823
+ }, z.core.$strip>;
824
+ declare const zGetTaskPath: z.ZodMiniObject<{
825
+ id: z.ZodMiniString<string>;
826
+ }, z.core.$strip>;
827
+ declare const zGetTaskQuery: z.ZodMiniObject<{
828
+ includeEncrypted: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
829
+ tree: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
830
+ treeFull: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
831
+ showCreated: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
832
+ showCreatedDate: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
833
+ showCompleted: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
834
+ }, z.core.$strip>;
835
+ /**
836
+ * A task
837
+ */
838
+ declare const zGetTaskResponse: z.ZodMiniObject<{
839
+ id: z.ZodMiniOptional<z.ZodMiniString<string>>;
840
+ pr_token: z.ZodMiniOptional<z.ZodMiniString<string>>;
841
+ title: z.ZodMiniOptional<z.ZodMiniString<string>>;
842
+ description: z.ZodMiniOptional<z.ZodMiniString<string>>;
843
+ encrypted: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
844
+ deadline: z.ZodMiniOptional<z.ZodMiniString<string>>;
845
+ deadline_date: z.ZodMiniOptional<z.iso.ZodMiniISODateTime>;
846
+ status: z.ZodMiniOptional<z.ZodMiniEnum<{
847
+ ACTIVE: "ACTIVE";
848
+ COMPLETED: "COMPLETED";
849
+ CANCELLED: "CANCELLED";
850
+ READY: "READY";
851
+ IN_PROGRESS: "IN_PROGRESS";
852
+ WAITING: "WAITING";
853
+ DELEGATED: "DELEGATED";
854
+ }>>;
855
+ completion: z.ZodMiniOptional<z.ZodMiniString<string>>;
856
+ worked_time: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
857
+ priority: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniUnion<readonly [z.ZodMiniLiteral<1>, z.ZodMiniLiteral<2>, z.ZodMiniLiteral<3>]>>>;
858
+ created: z.ZodMiniOptional<z.ZodMiniString<string>>;
859
+ blocked_by: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
860
+ children: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniLazy<any>]>>>;
861
+ parents: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
862
+ }, z.core.$strip>;
863
+ declare const zUpdateTaskBody: z.ZodMiniObject<{
864
+ title: z.ZodMiniOptional<z.ZodMiniString<string>>;
865
+ description: z.ZodMiniOptional<z.ZodMiniString<string>>;
866
+ deadline: z.ZodMiniOptional<z.ZodMiniString<string>>;
867
+ status: z.ZodMiniOptional<z.ZodMiniEnum<{
868
+ ACTIVE: "ACTIVE";
869
+ COMPLETED: "COMPLETED";
870
+ CANCELLED: "CANCELLED";
871
+ READY: "READY";
872
+ IN_PROGRESS: "IN_PROGRESS";
873
+ WAITING: "WAITING";
874
+ DELEGATED: "DELEGATED";
875
+ }>>;
876
+ priority: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniLiteral<0>, z.ZodMiniLiteral<1>, z.ZodMiniLiteral<2>, z.ZodMiniLiteral<3>]>>;
877
+ add_parent: z.ZodMiniOptional<z.ZodMiniString<string>>;
878
+ remove_parent: z.ZodMiniOptional<z.ZodMiniString<string>>;
879
+ replace_parent: z.ZodMiniOptional<z.ZodMiniString<string>>;
880
+ replace_parent_from: z.ZodMiniOptional<z.ZodMiniString<string>>;
881
+ block: z.ZodMiniOptional<z.ZodMiniString<string>>;
882
+ removeBlock: z.ZodMiniOptional<z.ZodMiniString<string>>;
883
+ }, z.core.$strip>;
884
+ declare const zUpdateTaskPath: z.ZodMiniObject<{
885
+ id: z.ZodMiniString<string>;
886
+ }, z.core.$strip>;
887
+ /**
888
+ * Updated
889
+ */
890
+ declare const zUpdateTaskResponse: z.ZodMiniObject<{
891
+ id: z.ZodMiniOptional<z.ZodMiniString<string>>;
892
+ pr_token: z.ZodMiniOptional<z.ZodMiniString<string>>;
893
+ title: z.ZodMiniOptional<z.ZodMiniString<string>>;
894
+ description: z.ZodMiniOptional<z.ZodMiniString<string>>;
895
+ encrypted: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
896
+ deadline: z.ZodMiniOptional<z.ZodMiniString<string>>;
897
+ deadline_date: z.ZodMiniOptional<z.iso.ZodMiniISODateTime>;
898
+ status: z.ZodMiniOptional<z.ZodMiniEnum<{
899
+ ACTIVE: "ACTIVE";
900
+ COMPLETED: "COMPLETED";
901
+ CANCELLED: "CANCELLED";
902
+ READY: "READY";
903
+ IN_PROGRESS: "IN_PROGRESS";
904
+ WAITING: "WAITING";
905
+ DELEGATED: "DELEGATED";
906
+ }>>;
907
+ completion: z.ZodMiniOptional<z.ZodMiniString<string>>;
908
+ worked_time: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
909
+ priority: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniUnion<readonly [z.ZodMiniLiteral<1>, z.ZodMiniLiteral<2>, z.ZodMiniLiteral<3>]>>>;
910
+ created: z.ZodMiniOptional<z.ZodMiniString<string>>;
911
+ blocked_by: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
912
+ children: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniLazy<any>]>>>;
913
+ parents: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
914
+ }, z.core.$strip>;
915
+ declare const zListTaskPullRequestsPath: z.ZodMiniObject<{
916
+ id: z.ZodMiniString<string>;
917
+ }, z.core.$strip>;
918
+ /**
919
+ * Linked pull requests (oldest first)
920
+ */
921
+ declare const zListTaskPullRequestsResponse: z.ZodMiniArray<z.ZodMiniObject<{
922
+ id: z.ZodMiniUUID;
923
+ repo: z.ZodMiniString<string>;
924
+ number: z.ZodMiniNumberFormat;
925
+ title: z.ZodMiniString<string>;
926
+ url: z.ZodMiniString<string>;
927
+ state: z.ZodMiniEnum<{
928
+ open: "open";
929
+ closed: "closed";
930
+ merged: "merged";
931
+ }>;
932
+ draft: z.ZodMiniOptional<z.ZodMiniLiteral<true>>;
933
+ checks: z.ZodMiniOptional<z.ZodMiniEnum<{
934
+ pending: "pending";
935
+ success: "success";
936
+ failure: "failure";
937
+ }>>;
938
+ review: z.ZodMiniOptional<z.ZodMiniEnum<{
939
+ approved: "approved";
940
+ changes_requested: "changes_requested";
941
+ }>>;
942
+ preview_url: z.ZodMiniOptional<z.ZodMiniString<string>>;
943
+ linked_by: z.ZodMiniEnum<{
944
+ auto: "auto";
945
+ manual: "manual";
946
+ }>;
947
+ }, z.core.$strip>>;
948
+ declare const zLinkTaskPullRequestBody: z.ZodMiniObject<{
949
+ url: z.ZodMiniString<string>;
950
+ }, z.core.$strip>;
951
+ declare const zLinkTaskPullRequestPath: z.ZodMiniObject<{
952
+ id: z.ZodMiniString<string>;
953
+ }, z.core.$strip>;
954
+ /**
955
+ * Linked
956
+ */
957
+ declare const zLinkTaskPullRequestResponse: z.ZodMiniObject<{
958
+ id: z.ZodMiniUUID;
959
+ repo: z.ZodMiniString<string>;
960
+ number: z.ZodMiniNumberFormat;
961
+ title: z.ZodMiniString<string>;
962
+ url: z.ZodMiniString<string>;
963
+ state: z.ZodMiniEnum<{
964
+ open: "open";
965
+ closed: "closed";
966
+ merged: "merged";
967
+ }>;
968
+ draft: z.ZodMiniOptional<z.ZodMiniLiteral<true>>;
969
+ checks: z.ZodMiniOptional<z.ZodMiniEnum<{
970
+ pending: "pending";
971
+ success: "success";
972
+ failure: "failure";
973
+ }>>;
974
+ review: z.ZodMiniOptional<z.ZodMiniEnum<{
975
+ approved: "approved";
976
+ changes_requested: "changes_requested";
977
+ }>>;
978
+ preview_url: z.ZodMiniOptional<z.ZodMiniString<string>>;
979
+ linked_by: z.ZodMiniEnum<{
980
+ auto: "auto";
981
+ manual: "manual";
982
+ }>;
983
+ }, z.core.$strip>;
984
+ declare const zUnlinkTaskPullRequestPath: z.ZodMiniObject<{
985
+ id: z.ZodMiniString<string>;
986
+ prId: z.ZodMiniUUID;
987
+ }, z.core.$strip>;
988
+ /**
989
+ * Unlinked
990
+ */
991
+ declare const zUnlinkTaskPullRequestResponse: z.ZodMiniVoid;
549
992
 
550
993
  interface PerspecTaskOptions {
551
994
  /**
@@ -629,6 +1072,46 @@ declare function createTasksNamespace(client: Client): {
629
1072
  request?: Request;
630
1073
  response?: Response;
631
1074
  }>;
1075
+ /**
1076
+ * GitHub pull requests linked to a task. Usually you don't need these: put
1077
+ * the task's `pr_token` (e.g. `pt-a3f91c2`, on `tasks.get`) in a PR title
1078
+ * or branch name and the PR links itself.
1079
+ */
1080
+ pullRequests: {
1081
+ /** List the task's linked PRs (state, checks, review, preview). Wraps `PullRequests.listTaskPullRequests`. */
1082
+ list: (id: string) => Promise<({
1083
+ data: PullRequest[];
1084
+ error: undefined;
1085
+ } | {
1086
+ data: undefined;
1087
+ error: unknown;
1088
+ }) & {
1089
+ request?: Request;
1090
+ response?: Response;
1091
+ }>;
1092
+ /** Link a PR by URL (`https://github.com/o/r/pull/12` or `o/r#12`). Wraps `PullRequests.linkTaskPullRequest`. */
1093
+ link: (id: string, url: string) => Promise<({
1094
+ data: PullRequest;
1095
+ error: undefined;
1096
+ } | {
1097
+ data: undefined;
1098
+ error: unknown;
1099
+ }) & {
1100
+ request?: Request;
1101
+ response?: Response;
1102
+ }>;
1103
+ /** Unlink by the link `id` from `list`. Wraps `PullRequests.unlinkTaskPullRequest`. */
1104
+ unlink: (id: string, prId: string) => Promise<({
1105
+ data: void;
1106
+ error: undefined;
1107
+ } | {
1108
+ data: undefined;
1109
+ error: unknown;
1110
+ }) & {
1111
+ request?: Request;
1112
+ response?: Response;
1113
+ }>;
1114
+ };
632
1115
  };
633
1116
 
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 };
1117
+ export { type ClientOptions, type CreateTaskData, type CreateTaskResponse, type CreateTaskResponses, type GetTaskData, type GetTaskErrors, type GetTaskResponse, type GetTaskResponses, type LinkTaskPullRequestData, type LinkTaskPullRequestErrors, type LinkTaskPullRequestResponse, type LinkTaskPullRequestResponses, type ListTaskPullRequestsData, type ListTaskPullRequestsErrors, type ListTaskPullRequestsResponse, type ListTaskPullRequestsResponses, type ListTasksData, type ListTasksResponse, type ListTasksResponses, type Options, PerspecTask, type PerspecTaskOptions, type PullRequest, PullRequests, type Task, Tasks, type UnlinkTaskPullRequestData, type UnlinkTaskPullRequestErrors, type UnlinkTaskPullRequestResponse, type UnlinkTaskPullRequestResponses, type UpdateTaskData, type UpdateTaskErrors, type UpdateTaskResponse, type UpdateTaskResponses, PerspecTask as default, zCreateTaskBody, zCreateTaskResponse, zGetTaskPath, zGetTaskQuery, zGetTaskResponse, zLinkTaskPullRequestBody, zLinkTaskPullRequestPath, zLinkTaskPullRequestResponse, zListTaskPullRequestsPath, zListTaskPullRequestsResponse, zListTasksQuery, zListTasksResponse, zPullRequest, zTask, zUnlinkTaskPullRequestPath, zUnlinkTaskPullRequestResponse, zUpdateTaskBody, zUpdateTaskPath, zUpdateTaskResponse };