@perspectask/sdk 1.0.0 → 1.2.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/README.md +48 -0
- package/dist/index.cjs +457 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +934 -2
- package/dist/index.d.ts +934 -2
- package/dist/index.js +423 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -400,6 +400,107 @@ type PullRequest = {
|
|
|
400
400
|
*/
|
|
401
401
|
linked_by: 'auto' | 'manual';
|
|
402
402
|
};
|
|
403
|
+
type KpiEntry = {
|
|
404
|
+
/**
|
|
405
|
+
* Id of this entry. Pass it to update or delete.
|
|
406
|
+
*/
|
|
407
|
+
id: string;
|
|
408
|
+
/**
|
|
409
|
+
* `target` = the number you aim for (by `at`); `actual` = a reading of where it stands at `at`.
|
|
410
|
+
*/
|
|
411
|
+
kind: 'target' | 'actual';
|
|
412
|
+
/**
|
|
413
|
+
* ISO 8601 UTC instant. Omitted for a target with no date.
|
|
414
|
+
*/
|
|
415
|
+
at?: string;
|
|
416
|
+
/**
|
|
417
|
+
* The number. Omitted when the entry was saved end-to-end encrypted (then `encrypted` is true).
|
|
418
|
+
*/
|
|
419
|
+
value?: number;
|
|
420
|
+
/**
|
|
421
|
+
* Only present when the value is end-to-end encrypted and so not readable over the API.
|
|
422
|
+
*/
|
|
423
|
+
encrypted?: true;
|
|
424
|
+
};
|
|
425
|
+
type Timer = {
|
|
426
|
+
/**
|
|
427
|
+
* Id of this timer. Pass it to update it.
|
|
428
|
+
*/
|
|
429
|
+
id: string;
|
|
430
|
+
/**
|
|
431
|
+
* The task (short id). Its title comes from `GET /tasks/{id}`.
|
|
432
|
+
*/
|
|
433
|
+
task_id: string;
|
|
434
|
+
/**
|
|
435
|
+
* ISO 8601 UTC instant.
|
|
436
|
+
*/
|
|
437
|
+
started_at: string;
|
|
438
|
+
/**
|
|
439
|
+
* ISO 8601 UTC instant. Omitted while it runs.
|
|
440
|
+
*/
|
|
441
|
+
ended_at?: string;
|
|
442
|
+
/**
|
|
443
|
+
* Seconds between start and end. Omitted while it runs.
|
|
444
|
+
*/
|
|
445
|
+
duration?: number;
|
|
446
|
+
/**
|
|
447
|
+
* Only present on the running timer.
|
|
448
|
+
*/
|
|
449
|
+
running?: true;
|
|
450
|
+
/**
|
|
451
|
+
* Only on a stop: the timer ran under 5 seconds, so it was deleted instead of kept.
|
|
452
|
+
*/
|
|
453
|
+
discarded?: true;
|
|
454
|
+
};
|
|
455
|
+
type TimerStatus = {
|
|
456
|
+
/**
|
|
457
|
+
* Seconds of finished timers since the start of the day (`day_start`, default midnight UTC).
|
|
458
|
+
*/
|
|
459
|
+
worked_today: number;
|
|
460
|
+
running?: Timer & unknown;
|
|
461
|
+
};
|
|
462
|
+
type StartTimerResponse = {
|
|
463
|
+
timer: Timer & unknown;
|
|
464
|
+
stopped?: Timer & unknown;
|
|
465
|
+
/**
|
|
466
|
+
* Only present when this task’s timer was already running; nothing changed.
|
|
467
|
+
*/
|
|
468
|
+
already_running?: true;
|
|
469
|
+
};
|
|
470
|
+
type HistoryEntry = {
|
|
471
|
+
/**
|
|
472
|
+
* The task (short id).
|
|
473
|
+
*/
|
|
474
|
+
task_id: string;
|
|
475
|
+
/**
|
|
476
|
+
* What changed: `created`, `status`, `priority`, `scheduled`, `parent_added`, `parent_removed`, `title`, `description`, `encryption`.
|
|
477
|
+
*/
|
|
478
|
+
action: string;
|
|
479
|
+
/**
|
|
480
|
+
* When it changed (ISO 8601 UTC).
|
|
481
|
+
*/
|
|
482
|
+
at: string;
|
|
483
|
+
/**
|
|
484
|
+
* The value before. `status`: the label (e.g. `IN_PROGRESS`); `priority`: the number; `scheduled`: the deadline column id (e.g. `w-48-2026`); `title`/`description`: the text. Omitted when there was none.
|
|
485
|
+
*/
|
|
486
|
+
old?: string;
|
|
487
|
+
/**
|
|
488
|
+
* The value after, same forms as `old`. For `parent_added`/`parent_removed` it is the parent task (short id). Omitted when cleared.
|
|
489
|
+
*/
|
|
490
|
+
new?: string;
|
|
491
|
+
/**
|
|
492
|
+
* The note given for the change (e.g. why a deadline moved).
|
|
493
|
+
*/
|
|
494
|
+
reason?: string;
|
|
495
|
+
/**
|
|
496
|
+
* Who made it when it was not the owner in the web app: `apikey:<key prefix>` or `oauth:<app name>`. Omitted for the owner.
|
|
497
|
+
*/
|
|
498
|
+
actor?: string;
|
|
499
|
+
/**
|
|
500
|
+
* Only on a `title`/`description` edit saved end-to-end encrypted: its text is omitted.
|
|
501
|
+
*/
|
|
502
|
+
encrypted?: true;
|
|
503
|
+
};
|
|
403
504
|
type ListTasksData = {
|
|
404
505
|
body?: never;
|
|
405
506
|
path?: never;
|
|
@@ -650,6 +751,344 @@ type UnlinkTaskPullRequestResponses = {
|
|
|
650
751
|
204: void;
|
|
651
752
|
};
|
|
652
753
|
type UnlinkTaskPullRequestResponse = UnlinkTaskPullRequestResponses[keyof UnlinkTaskPullRequestResponses];
|
|
754
|
+
type ListKpiTasksData = {
|
|
755
|
+
body?: never;
|
|
756
|
+
path?: never;
|
|
757
|
+
query?: never;
|
|
758
|
+
url: '/kpis';
|
|
759
|
+
};
|
|
760
|
+
type ListKpiTasksResponses = {
|
|
761
|
+
/**
|
|
762
|
+
* Short ids of the tasks that have KPI entries.
|
|
763
|
+
*/
|
|
764
|
+
200: Array<string>;
|
|
765
|
+
};
|
|
766
|
+
type ListKpiTasksResponse = ListKpiTasksResponses[keyof ListKpiTasksResponses];
|
|
767
|
+
type ListTaskKpisData = {
|
|
768
|
+
body?: never;
|
|
769
|
+
path: {
|
|
770
|
+
id: string;
|
|
771
|
+
};
|
|
772
|
+
query?: never;
|
|
773
|
+
url: '/tasks/{id}/kpis';
|
|
774
|
+
};
|
|
775
|
+
type ListTaskKpisErrors = {
|
|
776
|
+
/**
|
|
777
|
+
* Task is encrypted
|
|
778
|
+
*/
|
|
779
|
+
403: unknown;
|
|
780
|
+
/**
|
|
781
|
+
* Task not found
|
|
782
|
+
*/
|
|
783
|
+
404: unknown;
|
|
784
|
+
};
|
|
785
|
+
type ListTaskKpisResponses = {
|
|
786
|
+
/**
|
|
787
|
+
* KPI entries
|
|
788
|
+
*/
|
|
789
|
+
200: Array<KpiEntry>;
|
|
790
|
+
};
|
|
791
|
+
type ListTaskKpisResponse = ListTaskKpisResponses[keyof ListTaskKpisResponses];
|
|
792
|
+
type CreateTaskKpiData = {
|
|
793
|
+
body: {
|
|
794
|
+
kind: 'target' | 'actual';
|
|
795
|
+
value: number;
|
|
796
|
+
/**
|
|
797
|
+
* When the target is due, or when the actual was measured. Required for an actual; a target may have none.
|
|
798
|
+
*/
|
|
799
|
+
at?: string;
|
|
800
|
+
};
|
|
801
|
+
path: {
|
|
802
|
+
id: string;
|
|
803
|
+
};
|
|
804
|
+
query?: never;
|
|
805
|
+
url: '/tasks/{id}/kpis';
|
|
806
|
+
};
|
|
807
|
+
type CreateTaskKpiErrors = {
|
|
808
|
+
/**
|
|
809
|
+
* Invalid entry (e.g. an actual without `at`)
|
|
810
|
+
*/
|
|
811
|
+
400: unknown;
|
|
812
|
+
/**
|
|
813
|
+
* Task is encrypted
|
|
814
|
+
*/
|
|
815
|
+
403: unknown;
|
|
816
|
+
/**
|
|
817
|
+
* Task not found
|
|
818
|
+
*/
|
|
819
|
+
404: unknown;
|
|
820
|
+
};
|
|
821
|
+
type CreateTaskKpiResponses = {
|
|
822
|
+
/**
|
|
823
|
+
* Created
|
|
824
|
+
*/
|
|
825
|
+
201: KpiEntry;
|
|
826
|
+
};
|
|
827
|
+
type CreateTaskKpiResponse = CreateTaskKpiResponses[keyof CreateTaskKpiResponses];
|
|
828
|
+
type DeleteTaskKpiData = {
|
|
829
|
+
body?: never;
|
|
830
|
+
path: {
|
|
831
|
+
id: string;
|
|
832
|
+
/**
|
|
833
|
+
* The entry id (`id` from the KPI list).
|
|
834
|
+
*/
|
|
835
|
+
kpiId: string;
|
|
836
|
+
};
|
|
837
|
+
query?: never;
|
|
838
|
+
url: '/tasks/{id}/kpis/{kpiId}';
|
|
839
|
+
};
|
|
840
|
+
type DeleteTaskKpiErrors = {
|
|
841
|
+
/**
|
|
842
|
+
* Task is encrypted
|
|
843
|
+
*/
|
|
844
|
+
403: unknown;
|
|
845
|
+
/**
|
|
846
|
+
* Task or entry not found
|
|
847
|
+
*/
|
|
848
|
+
404: unknown;
|
|
849
|
+
};
|
|
850
|
+
type DeleteTaskKpiResponses = {
|
|
851
|
+
/**
|
|
852
|
+
* Deleted
|
|
853
|
+
*/
|
|
854
|
+
204: void;
|
|
855
|
+
};
|
|
856
|
+
type DeleteTaskKpiResponse = DeleteTaskKpiResponses[keyof DeleteTaskKpiResponses];
|
|
857
|
+
type UpdateTaskKpiData = {
|
|
858
|
+
body: {
|
|
859
|
+
kind?: 'target' | 'actual';
|
|
860
|
+
value?: number;
|
|
861
|
+
/**
|
|
862
|
+
* `null` removes the date (a target only).
|
|
863
|
+
*/
|
|
864
|
+
at?: string | null;
|
|
865
|
+
};
|
|
866
|
+
path: {
|
|
867
|
+
id: string;
|
|
868
|
+
/**
|
|
869
|
+
* The entry id (`id` from the KPI list).
|
|
870
|
+
*/
|
|
871
|
+
kpiId: string;
|
|
872
|
+
};
|
|
873
|
+
query?: never;
|
|
874
|
+
url: '/tasks/{id}/kpis/{kpiId}';
|
|
875
|
+
};
|
|
876
|
+
type UpdateTaskKpiErrors = {
|
|
877
|
+
/**
|
|
878
|
+
* Nothing to update, or an actual left without `at`
|
|
879
|
+
*/
|
|
880
|
+
400: unknown;
|
|
881
|
+
/**
|
|
882
|
+
* Task is encrypted
|
|
883
|
+
*/
|
|
884
|
+
403: unknown;
|
|
885
|
+
/**
|
|
886
|
+
* Task or entry not found
|
|
887
|
+
*/
|
|
888
|
+
404: unknown;
|
|
889
|
+
};
|
|
890
|
+
type UpdateTaskKpiResponses = {
|
|
891
|
+
/**
|
|
892
|
+
* Updated
|
|
893
|
+
*/
|
|
894
|
+
200: KpiEntry;
|
|
895
|
+
};
|
|
896
|
+
type UpdateTaskKpiResponse = UpdateTaskKpiResponses[keyof UpdateTaskKpiResponses];
|
|
897
|
+
type GetTimerStatusData = {
|
|
898
|
+
body?: never;
|
|
899
|
+
path?: never;
|
|
900
|
+
query?: {
|
|
901
|
+
/**
|
|
902
|
+
* Start of the user's day, so `worked_today` follows their time zone, e.g. `2026-11-23T00:00:00+02:00`. Defaults to midnight UTC.
|
|
903
|
+
*/
|
|
904
|
+
day_start?: string;
|
|
905
|
+
};
|
|
906
|
+
url: '/timers/status';
|
|
907
|
+
};
|
|
908
|
+
type GetTimerStatusResponses = {
|
|
909
|
+
/**
|
|
910
|
+
* Timer status
|
|
911
|
+
*/
|
|
912
|
+
200: TimerStatus;
|
|
913
|
+
};
|
|
914
|
+
type GetTimerStatusResponse = GetTimerStatusResponses[keyof GetTimerStatusResponses];
|
|
915
|
+
type ListTimersData = {
|
|
916
|
+
body?: never;
|
|
917
|
+
path?: never;
|
|
918
|
+
query?: {
|
|
919
|
+
/**
|
|
920
|
+
* Only this task’s timers (full UUID or short id).
|
|
921
|
+
*/
|
|
922
|
+
task_id?: string;
|
|
923
|
+
/**
|
|
924
|
+
* Only timers started at or after this instant.
|
|
925
|
+
*/
|
|
926
|
+
since?: string;
|
|
927
|
+
/**
|
|
928
|
+
* Most entries to return, newest first. Defaults to 200, at most 1000.
|
|
929
|
+
*/
|
|
930
|
+
limit?: number;
|
|
931
|
+
};
|
|
932
|
+
url: '/timers';
|
|
933
|
+
};
|
|
934
|
+
type ListTimersErrors = {
|
|
935
|
+
/**
|
|
936
|
+
* Task not found (`task_id`)
|
|
937
|
+
*/
|
|
938
|
+
404: unknown;
|
|
939
|
+
};
|
|
940
|
+
type ListTimersResponses = {
|
|
941
|
+
/**
|
|
942
|
+
* Timers
|
|
943
|
+
*/
|
|
944
|
+
200: Array<Timer>;
|
|
945
|
+
};
|
|
946
|
+
type ListTimersResponse = ListTimersResponses[keyof ListTimersResponses];
|
|
947
|
+
type StartTaskTimerData = {
|
|
948
|
+
body?: never;
|
|
949
|
+
path: {
|
|
950
|
+
id: string;
|
|
951
|
+
};
|
|
952
|
+
query?: never;
|
|
953
|
+
url: '/tasks/{id}/timers';
|
|
954
|
+
};
|
|
955
|
+
type StartTaskTimerErrors = {
|
|
956
|
+
/**
|
|
957
|
+
* The task is completed or cancelled
|
|
958
|
+
*/
|
|
959
|
+
400: unknown;
|
|
960
|
+
/**
|
|
961
|
+
* Task is encrypted
|
|
962
|
+
*/
|
|
963
|
+
403: unknown;
|
|
964
|
+
/**
|
|
965
|
+
* Task not found
|
|
966
|
+
*/
|
|
967
|
+
404: unknown;
|
|
968
|
+
};
|
|
969
|
+
type StartTaskTimerResponses = {
|
|
970
|
+
/**
|
|
971
|
+
* Already running
|
|
972
|
+
*/
|
|
973
|
+
200: StartTimerResponse;
|
|
974
|
+
/**
|
|
975
|
+
* Started
|
|
976
|
+
*/
|
|
977
|
+
201: StartTimerResponse;
|
|
978
|
+
};
|
|
979
|
+
type StartTaskTimerResponse = StartTaskTimerResponses[keyof StartTaskTimerResponses];
|
|
980
|
+
type StopTimerData = {
|
|
981
|
+
body?: never;
|
|
982
|
+
path?: never;
|
|
983
|
+
query?: never;
|
|
984
|
+
url: '/timers/stop';
|
|
985
|
+
};
|
|
986
|
+
type StopTimerErrors = {
|
|
987
|
+
/**
|
|
988
|
+
* No timer is running
|
|
989
|
+
*/
|
|
990
|
+
404: unknown;
|
|
991
|
+
};
|
|
992
|
+
type StopTimerResponses = {
|
|
993
|
+
/**
|
|
994
|
+
* Stopped
|
|
995
|
+
*/
|
|
996
|
+
200: Timer;
|
|
997
|
+
};
|
|
998
|
+
type StopTimerResponse = StopTimerResponses[keyof StopTimerResponses];
|
|
999
|
+
type UpdateTimerData = {
|
|
1000
|
+
body: {
|
|
1001
|
+
/**
|
|
1002
|
+
* New start, ISO 8601 with `Z` or an offset.
|
|
1003
|
+
*/
|
|
1004
|
+
started_at?: string;
|
|
1005
|
+
/**
|
|
1006
|
+
* New end, ISO 8601 with `Z` or an offset.
|
|
1007
|
+
*/
|
|
1008
|
+
ended_at?: string;
|
|
1009
|
+
};
|
|
1010
|
+
path: {
|
|
1011
|
+
/**
|
|
1012
|
+
* The timer id (`id` from the timer list).
|
|
1013
|
+
*/
|
|
1014
|
+
timerId: string;
|
|
1015
|
+
};
|
|
1016
|
+
query?: never;
|
|
1017
|
+
url: '/timers/{timerId}';
|
|
1018
|
+
};
|
|
1019
|
+
type UpdateTimerErrors = {
|
|
1020
|
+
/**
|
|
1021
|
+
* Invalid change
|
|
1022
|
+
*/
|
|
1023
|
+
400: unknown;
|
|
1024
|
+
/**
|
|
1025
|
+
* The timer's task is encrypted
|
|
1026
|
+
*/
|
|
1027
|
+
403: unknown;
|
|
1028
|
+
/**
|
|
1029
|
+
* Timer or its task not found
|
|
1030
|
+
*/
|
|
1031
|
+
404: unknown;
|
|
1032
|
+
};
|
|
1033
|
+
type UpdateTimerResponses = {
|
|
1034
|
+
/**
|
|
1035
|
+
* Updated
|
|
1036
|
+
*/
|
|
1037
|
+
200: Timer;
|
|
1038
|
+
};
|
|
1039
|
+
type UpdateTimerResponse = UpdateTimerResponses[keyof UpdateTimerResponses];
|
|
1040
|
+
type ListTasksHistoryData = {
|
|
1041
|
+
body?: never;
|
|
1042
|
+
path?: never;
|
|
1043
|
+
query?: {
|
|
1044
|
+
/**
|
|
1045
|
+
* Only changes at or after this instant.
|
|
1046
|
+
*/
|
|
1047
|
+
since?: string;
|
|
1048
|
+
/**
|
|
1049
|
+
* Most entries to return, newest first. Defaults to 200, at most 1000.
|
|
1050
|
+
*/
|
|
1051
|
+
limit?: number;
|
|
1052
|
+
};
|
|
1053
|
+
url: '/tasks/history';
|
|
1054
|
+
};
|
|
1055
|
+
type ListTasksHistoryResponses = {
|
|
1056
|
+
/**
|
|
1057
|
+
* History
|
|
1058
|
+
*/
|
|
1059
|
+
200: Array<HistoryEntry>;
|
|
1060
|
+
};
|
|
1061
|
+
type ListTasksHistoryResponse = ListTasksHistoryResponses[keyof ListTasksHistoryResponses];
|
|
1062
|
+
type ListTaskHistoryData = {
|
|
1063
|
+
body?: never;
|
|
1064
|
+
path: {
|
|
1065
|
+
id: string;
|
|
1066
|
+
};
|
|
1067
|
+
query?: {
|
|
1068
|
+
/**
|
|
1069
|
+
* Most entries to return, newest first. Defaults to 200, at most 1000.
|
|
1070
|
+
*/
|
|
1071
|
+
limit?: number;
|
|
1072
|
+
};
|
|
1073
|
+
url: '/tasks/{id}/history';
|
|
1074
|
+
};
|
|
1075
|
+
type ListTaskHistoryErrors = {
|
|
1076
|
+
/**
|
|
1077
|
+
* Task is encrypted
|
|
1078
|
+
*/
|
|
1079
|
+
403: unknown;
|
|
1080
|
+
/**
|
|
1081
|
+
* Task not found
|
|
1082
|
+
*/
|
|
1083
|
+
404: unknown;
|
|
1084
|
+
};
|
|
1085
|
+
type ListTaskHistoryResponses = {
|
|
1086
|
+
/**
|
|
1087
|
+
* History
|
|
1088
|
+
*/
|
|
1089
|
+
200: Array<HistoryEntry>;
|
|
1090
|
+
};
|
|
1091
|
+
type ListTaskHistoryResponse = ListTaskHistoryResponses[keyof ListTaskHistoryResponses];
|
|
653
1092
|
|
|
654
1093
|
type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options$1<TData, ThrowOnError, TResponse> & {
|
|
655
1094
|
/**
|
|
@@ -681,6 +1120,18 @@ declare class Tasks {
|
|
|
681
1120
|
* Update a task
|
|
682
1121
|
*/
|
|
683
1122
|
static updateTask<ThrowOnError extends boolean = false>(options: Options<UpdateTaskData, ThrowOnError>): RequestResult<UpdateTaskResponses, UpdateTaskErrors, ThrowOnError, "fields">;
|
|
1123
|
+
/**
|
|
1124
|
+
* List the history of all tasks
|
|
1125
|
+
*
|
|
1126
|
+
* Every change to your tasks, newest first: status, priority, deadline, parents, title and description edits. Recorded automatically on every change; nobody can edit it. Changes made through the API or a connected app carry an `actor`. Encrypted and deleted tasks are left out.
|
|
1127
|
+
*/
|
|
1128
|
+
static listTasksHistory<ThrowOnError extends boolean = false>(options?: Options<ListTasksHistoryData, ThrowOnError>): RequestResult<ListTasksHistoryResponses, unknown, ThrowOnError, "fields">;
|
|
1129
|
+
/**
|
|
1130
|
+
* List the history of a task
|
|
1131
|
+
*
|
|
1132
|
+
* Every change to one task, newest first. Recorded automatically on every change; nobody can edit it. Changes made through the API or a connected app carry an `actor`.
|
|
1133
|
+
*/
|
|
1134
|
+
static listTaskHistory<ThrowOnError extends boolean = false>(options: Options<ListTaskHistoryData, ThrowOnError>): RequestResult<ListTaskHistoryResponses, ListTaskHistoryErrors, ThrowOnError, "fields">;
|
|
684
1135
|
}
|
|
685
1136
|
declare class PullRequests {
|
|
686
1137
|
/**
|
|
@@ -702,6 +1153,68 @@ declare class PullRequests {
|
|
|
702
1153
|
*/
|
|
703
1154
|
static unlinkTaskPullRequest<ThrowOnError extends boolean = false>(options: Options<UnlinkTaskPullRequestData, ThrowOnError>): RequestResult<UnlinkTaskPullRequestResponses, UnlinkTaskPullRequestErrors, ThrowOnError, "fields">;
|
|
704
1155
|
}
|
|
1156
|
+
declare class Kpis {
|
|
1157
|
+
/**
|
|
1158
|
+
* List tasks with KPIs
|
|
1159
|
+
*
|
|
1160
|
+
* Short ids of your tasks that have KPI entries. Encrypted tasks are left out. Fetch a task with `GET /tasks/{id}` for its title.
|
|
1161
|
+
*/
|
|
1162
|
+
static listKpiTasks<ThrowOnError extends boolean = false>(options?: Options<ListKpiTasksData, ThrowOnError>): RequestResult<ListKpiTasksResponses, unknown, ThrowOnError, "fields">;
|
|
1163
|
+
/**
|
|
1164
|
+
* List the KPI entries of a task
|
|
1165
|
+
*
|
|
1166
|
+
* The task's targets and actuals, oldest first (dateless targets first). Encrypted tasks are refused (403). An entry saved end-to-end encrypted in the web app comes back with `encrypted: true` and no `value`.
|
|
1167
|
+
*/
|
|
1168
|
+
static listTaskKpis<ThrowOnError extends boolean = false>(options: Options<ListTaskKpisData, ThrowOnError>): RequestResult<ListTaskKpisResponses, ListTaskKpisErrors, ThrowOnError, "fields">;
|
|
1169
|
+
/**
|
|
1170
|
+
* Add a KPI entry to a task
|
|
1171
|
+
*
|
|
1172
|
+
* Add a target (the number to reach, optionally by a date) or an actual (a reading at a moment; `at` required). Encrypted tasks are refused (403). An entry saved end-to-end encrypted in the web app comes back with `encrypted: true` and no `value`.
|
|
1173
|
+
*/
|
|
1174
|
+
static createTaskKpi<ThrowOnError extends boolean = false>(options: Options<CreateTaskKpiData, ThrowOnError>): RequestResult<CreateTaskKpiResponses, CreateTaskKpiErrors, ThrowOnError, "fields">;
|
|
1175
|
+
/**
|
|
1176
|
+
* Delete a KPI entry
|
|
1177
|
+
*/
|
|
1178
|
+
static deleteTaskKpi<ThrowOnError extends boolean = false>(options: Options<DeleteTaskKpiData, ThrowOnError>): RequestResult<DeleteTaskKpiResponses, DeleteTaskKpiErrors, ThrowOnError, "fields">;
|
|
1179
|
+
/**
|
|
1180
|
+
* Update a KPI entry
|
|
1181
|
+
*
|
|
1182
|
+
* Change any of `kind`, `value` and `at`. Only the fields you send change.
|
|
1183
|
+
*/
|
|
1184
|
+
static updateTaskKpi<ThrowOnError extends boolean = false>(options: Options<UpdateTaskKpiData, ThrowOnError>): RequestResult<UpdateTaskKpiResponses, UpdateTaskKpiErrors, ThrowOnError, "fields">;
|
|
1185
|
+
}
|
|
1186
|
+
declare class Timers {
|
|
1187
|
+
/**
|
|
1188
|
+
* Get the running timer and time worked today
|
|
1189
|
+
*
|
|
1190
|
+
* The running timer, if any, and the seconds of finished timers today. Pass `day_start` with the user's local midnight so today follows their time zone.
|
|
1191
|
+
*/
|
|
1192
|
+
static getTimerStatus<ThrowOnError extends boolean = false>(options?: Options<GetTimerStatusData, ThrowOnError>): RequestResult<GetTimerStatusResponses, unknown, ThrowOnError, "fields">;
|
|
1193
|
+
/**
|
|
1194
|
+
* List timers
|
|
1195
|
+
*
|
|
1196
|
+
* Your work sessions, newest first: which task, when it started and ended, and its duration in seconds. Filter by task with `task_id`. Timers of encrypted tasks are included (they hold no task content).
|
|
1197
|
+
*/
|
|
1198
|
+
static listTimers<ThrowOnError extends boolean = false>(options?: Options<ListTimersData, ThrowOnError>): RequestResult<ListTimersResponses, ListTimersErrors, ThrowOnError, "fields">;
|
|
1199
|
+
/**
|
|
1200
|
+
* Start a timer on a task
|
|
1201
|
+
*
|
|
1202
|
+
* Start tracking time on a task. Only one timer runs at a time, so a timer running on another task is stopped first (returned as `stopped`). Starting the task that already runs changes nothing (200, `already_running`). Refused for a completed or cancelled task (400) and an encrypted one (403).
|
|
1203
|
+
*/
|
|
1204
|
+
static startTaskTimer<ThrowOnError extends boolean = false>(options: Options<StartTaskTimerData, ThrowOnError>): RequestResult<StartTaskTimerResponses, StartTaskTimerErrors, ThrowOnError, "fields">;
|
|
1205
|
+
/**
|
|
1206
|
+
* Stop the running timer
|
|
1207
|
+
*
|
|
1208
|
+
* Stop whatever timer is running. A timer stopped under 5 seconds is deleted instead of kept (`discarded: true`).
|
|
1209
|
+
*/
|
|
1210
|
+
static stopTimer<ThrowOnError extends boolean = false>(options?: Options<StopTimerData, ThrowOnError>): RequestResult<StopTimerResponses, StopTimerErrors, ThrowOnError, "fields">;
|
|
1211
|
+
/**
|
|
1212
|
+
* Update a timer
|
|
1213
|
+
*
|
|
1214
|
+
* Change when a finished timer started and/or ended, e.g. to fix a forgotten stop. Refused for a running timer, a date in the future, a start after the end, or an overlap with another timer (400). Deleting a timer is only possible in the web app.
|
|
1215
|
+
*/
|
|
1216
|
+
static updateTimer<ThrowOnError extends boolean = false>(options: Options<UpdateTimerData, ThrowOnError>): RequestResult<UpdateTimerResponses, UpdateTimerErrors, ThrowOnError, "fields">;
|
|
1217
|
+
}
|
|
705
1218
|
|
|
706
1219
|
declare const zTask: z.ZodMiniObject<{
|
|
707
1220
|
id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
@@ -760,6 +1273,68 @@ declare const zPullRequest: z.ZodMiniObject<{
|
|
|
760
1273
|
manual: "manual";
|
|
761
1274
|
}>;
|
|
762
1275
|
}, z.core.$strip>;
|
|
1276
|
+
declare const zKpiEntry: z.ZodMiniObject<{
|
|
1277
|
+
id: z.ZodMiniUUID;
|
|
1278
|
+
kind: z.ZodMiniEnum<{
|
|
1279
|
+
target: "target";
|
|
1280
|
+
actual: "actual";
|
|
1281
|
+
}>;
|
|
1282
|
+
at: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
1283
|
+
value: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
1284
|
+
encrypted: z.ZodMiniOptional<z.ZodMiniLiteral<true>>;
|
|
1285
|
+
}, z.core.$strip>;
|
|
1286
|
+
declare const zTimer: z.ZodMiniObject<{
|
|
1287
|
+
id: z.ZodMiniUUID;
|
|
1288
|
+
task_id: z.ZodMiniString<string>;
|
|
1289
|
+
started_at: z.ZodMiniString<string>;
|
|
1290
|
+
ended_at: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
1291
|
+
duration: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
|
|
1292
|
+
running: z.ZodMiniOptional<z.ZodMiniLiteral<true>>;
|
|
1293
|
+
discarded: z.ZodMiniOptional<z.ZodMiniLiteral<true>>;
|
|
1294
|
+
}, z.core.$strip>;
|
|
1295
|
+
declare const zTimerStatus: z.ZodMiniObject<{
|
|
1296
|
+
worked_today: z.ZodMiniNumberFormat;
|
|
1297
|
+
running: z.ZodMiniOptional<z.ZodMiniIntersection<z.ZodMiniObject<{
|
|
1298
|
+
id: z.ZodMiniUUID;
|
|
1299
|
+
task_id: z.ZodMiniString<string>;
|
|
1300
|
+
started_at: z.ZodMiniString<string>;
|
|
1301
|
+
ended_at: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
1302
|
+
duration: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
|
|
1303
|
+
running: z.ZodMiniOptional<z.ZodMiniLiteral<true>>;
|
|
1304
|
+
discarded: z.ZodMiniOptional<z.ZodMiniLiteral<true>>;
|
|
1305
|
+
}, z.core.$strip>, z.ZodMiniUnknown>>;
|
|
1306
|
+
}, z.core.$strip>;
|
|
1307
|
+
declare const zStartTimerResponse: z.ZodMiniObject<{
|
|
1308
|
+
timer: z.ZodMiniIntersection<z.ZodMiniObject<{
|
|
1309
|
+
id: z.ZodMiniUUID;
|
|
1310
|
+
task_id: z.ZodMiniString<string>;
|
|
1311
|
+
started_at: z.ZodMiniString<string>;
|
|
1312
|
+
ended_at: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
1313
|
+
duration: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
|
|
1314
|
+
running: z.ZodMiniOptional<z.ZodMiniLiteral<true>>;
|
|
1315
|
+
discarded: z.ZodMiniOptional<z.ZodMiniLiteral<true>>;
|
|
1316
|
+
}, z.core.$strip>, z.ZodMiniUnknown>;
|
|
1317
|
+
stopped: z.ZodMiniOptional<z.ZodMiniIntersection<z.ZodMiniObject<{
|
|
1318
|
+
id: z.ZodMiniUUID;
|
|
1319
|
+
task_id: z.ZodMiniString<string>;
|
|
1320
|
+
started_at: z.ZodMiniString<string>;
|
|
1321
|
+
ended_at: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
1322
|
+
duration: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
|
|
1323
|
+
running: z.ZodMiniOptional<z.ZodMiniLiteral<true>>;
|
|
1324
|
+
discarded: z.ZodMiniOptional<z.ZodMiniLiteral<true>>;
|
|
1325
|
+
}, z.core.$strip>, z.ZodMiniUnknown>>;
|
|
1326
|
+
already_running: z.ZodMiniOptional<z.ZodMiniLiteral<true>>;
|
|
1327
|
+
}, z.core.$strip>;
|
|
1328
|
+
declare const zHistoryEntry: z.ZodMiniObject<{
|
|
1329
|
+
task_id: z.ZodMiniString<string>;
|
|
1330
|
+
action: z.ZodMiniString<string>;
|
|
1331
|
+
at: z.ZodMiniString<string>;
|
|
1332
|
+
old: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
1333
|
+
new: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
1334
|
+
reason: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
1335
|
+
actor: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
1336
|
+
encrypted: z.ZodMiniOptional<z.ZodMiniLiteral<true>>;
|
|
1337
|
+
}, z.core.$strip>;
|
|
763
1338
|
declare const zListTasksQuery: z.ZodMiniObject<{
|
|
764
1339
|
includeEncrypted: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
765
1340
|
tree: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
@@ -1009,11 +1584,219 @@ declare const zUnlinkTaskPullRequestPath: z.ZodMiniObject<{
|
|
|
1009
1584
|
* Unlinked
|
|
1010
1585
|
*/
|
|
1011
1586
|
declare const zUnlinkTaskPullRequestResponse: z.ZodMiniVoid;
|
|
1587
|
+
/**
|
|
1588
|
+
* Short ids of the tasks that have KPI entries.
|
|
1589
|
+
*/
|
|
1590
|
+
declare const zListKpiTasksResponse: z.ZodMiniArray<z.ZodMiniString<string>>;
|
|
1591
|
+
declare const zListTaskKpisPath: z.ZodMiniObject<{
|
|
1592
|
+
id: z.ZodMiniString<string>;
|
|
1593
|
+
}, z.core.$strip>;
|
|
1594
|
+
/**
|
|
1595
|
+
* KPI entries
|
|
1596
|
+
*/
|
|
1597
|
+
declare const zListTaskKpisResponse: z.ZodMiniArray<z.ZodMiniObject<{
|
|
1598
|
+
id: z.ZodMiniUUID;
|
|
1599
|
+
kind: z.ZodMiniEnum<{
|
|
1600
|
+
target: "target";
|
|
1601
|
+
actual: "actual";
|
|
1602
|
+
}>;
|
|
1603
|
+
at: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
1604
|
+
value: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
1605
|
+
encrypted: z.ZodMiniOptional<z.ZodMiniLiteral<true>>;
|
|
1606
|
+
}, z.core.$strip>>;
|
|
1607
|
+
declare const zCreateTaskKpiBody: z.ZodMiniObject<{
|
|
1608
|
+
kind: z.ZodMiniEnum<{
|
|
1609
|
+
target: "target";
|
|
1610
|
+
actual: "actual";
|
|
1611
|
+
}>;
|
|
1612
|
+
value: z.ZodMiniNumber<number>;
|
|
1613
|
+
at: z.ZodMiniOptional<z.iso.ZodMiniISODateTime>;
|
|
1614
|
+
}, z.core.$strip>;
|
|
1615
|
+
declare const zCreateTaskKpiPath: z.ZodMiniObject<{
|
|
1616
|
+
id: z.ZodMiniString<string>;
|
|
1617
|
+
}, z.core.$strip>;
|
|
1618
|
+
/**
|
|
1619
|
+
* Created
|
|
1620
|
+
*/
|
|
1621
|
+
declare const zCreateTaskKpiResponse: z.ZodMiniObject<{
|
|
1622
|
+
id: z.ZodMiniUUID;
|
|
1623
|
+
kind: z.ZodMiniEnum<{
|
|
1624
|
+
target: "target";
|
|
1625
|
+
actual: "actual";
|
|
1626
|
+
}>;
|
|
1627
|
+
at: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
1628
|
+
value: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
1629
|
+
encrypted: z.ZodMiniOptional<z.ZodMiniLiteral<true>>;
|
|
1630
|
+
}, z.core.$strip>;
|
|
1631
|
+
declare const zDeleteTaskKpiPath: z.ZodMiniObject<{
|
|
1632
|
+
id: z.ZodMiniString<string>;
|
|
1633
|
+
kpiId: z.ZodMiniUUID;
|
|
1634
|
+
}, z.core.$strip>;
|
|
1635
|
+
/**
|
|
1636
|
+
* Deleted
|
|
1637
|
+
*/
|
|
1638
|
+
declare const zDeleteTaskKpiResponse: z.ZodMiniVoid;
|
|
1639
|
+
declare const zUpdateTaskKpiBody: z.ZodMiniObject<{
|
|
1640
|
+
kind: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
1641
|
+
target: "target";
|
|
1642
|
+
actual: "actual";
|
|
1643
|
+
}>>;
|
|
1644
|
+
value: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
1645
|
+
at: z.ZodMiniOptional<z.ZodMiniNullable<z.iso.ZodMiniISODateTime>>;
|
|
1646
|
+
}, z.core.$strip>;
|
|
1647
|
+
declare const zUpdateTaskKpiPath: z.ZodMiniObject<{
|
|
1648
|
+
id: z.ZodMiniString<string>;
|
|
1649
|
+
kpiId: z.ZodMiniUUID;
|
|
1650
|
+
}, z.core.$strip>;
|
|
1651
|
+
/**
|
|
1652
|
+
* Updated
|
|
1653
|
+
*/
|
|
1654
|
+
declare const zUpdateTaskKpiResponse: z.ZodMiniObject<{
|
|
1655
|
+
id: z.ZodMiniUUID;
|
|
1656
|
+
kind: z.ZodMiniEnum<{
|
|
1657
|
+
target: "target";
|
|
1658
|
+
actual: "actual";
|
|
1659
|
+
}>;
|
|
1660
|
+
at: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
1661
|
+
value: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
1662
|
+
encrypted: z.ZodMiniOptional<z.ZodMiniLiteral<true>>;
|
|
1663
|
+
}, z.core.$strip>;
|
|
1664
|
+
declare const zGetTimerStatusQuery: z.ZodMiniObject<{
|
|
1665
|
+
day_start: z.ZodMiniOptional<z.iso.ZodMiniISODateTime>;
|
|
1666
|
+
}, z.core.$strip>;
|
|
1667
|
+
/**
|
|
1668
|
+
* Timer status
|
|
1669
|
+
*/
|
|
1670
|
+
declare const zGetTimerStatusResponse: z.ZodMiniObject<{
|
|
1671
|
+
worked_today: z.ZodMiniNumberFormat;
|
|
1672
|
+
running: z.ZodMiniOptional<z.ZodMiniIntersection<z.ZodMiniObject<{
|
|
1673
|
+
id: z.ZodMiniUUID;
|
|
1674
|
+
task_id: z.ZodMiniString<string>;
|
|
1675
|
+
started_at: z.ZodMiniString<string>;
|
|
1676
|
+
ended_at: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
1677
|
+
duration: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
|
|
1678
|
+
running: z.ZodMiniOptional<z.ZodMiniLiteral<true>>;
|
|
1679
|
+
discarded: z.ZodMiniOptional<z.ZodMiniLiteral<true>>;
|
|
1680
|
+
}, z.core.$strip>, z.ZodMiniUnknown>>;
|
|
1681
|
+
}, z.core.$strip>;
|
|
1682
|
+
declare const zListTimersQuery: z.ZodMiniObject<{
|
|
1683
|
+
task_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
1684
|
+
since: z.ZodMiniOptional<z.iso.ZodMiniISODateTime>;
|
|
1685
|
+
limit: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
|
|
1686
|
+
}, z.core.$strip>;
|
|
1687
|
+
/**
|
|
1688
|
+
* Timers
|
|
1689
|
+
*/
|
|
1690
|
+
declare const zListTimersResponse: z.ZodMiniArray<z.ZodMiniObject<{
|
|
1691
|
+
id: z.ZodMiniUUID;
|
|
1692
|
+
task_id: z.ZodMiniString<string>;
|
|
1693
|
+
started_at: z.ZodMiniString<string>;
|
|
1694
|
+
ended_at: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
1695
|
+
duration: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
|
|
1696
|
+
running: z.ZodMiniOptional<z.ZodMiniLiteral<true>>;
|
|
1697
|
+
discarded: z.ZodMiniOptional<z.ZodMiniLiteral<true>>;
|
|
1698
|
+
}, z.core.$strip>>;
|
|
1699
|
+
declare const zStartTaskTimerPath: z.ZodMiniObject<{
|
|
1700
|
+
id: z.ZodMiniString<string>;
|
|
1701
|
+
}, z.core.$strip>;
|
|
1702
|
+
/**
|
|
1703
|
+
* Already running
|
|
1704
|
+
*/
|
|
1705
|
+
declare const zStartTaskTimerResponse: z.ZodMiniObject<{
|
|
1706
|
+
timer: z.ZodMiniIntersection<z.ZodMiniObject<{
|
|
1707
|
+
id: z.ZodMiniUUID;
|
|
1708
|
+
task_id: z.ZodMiniString<string>;
|
|
1709
|
+
started_at: z.ZodMiniString<string>;
|
|
1710
|
+
ended_at: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
1711
|
+
duration: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
|
|
1712
|
+
running: z.ZodMiniOptional<z.ZodMiniLiteral<true>>;
|
|
1713
|
+
discarded: z.ZodMiniOptional<z.ZodMiniLiteral<true>>;
|
|
1714
|
+
}, z.core.$strip>, z.ZodMiniUnknown>;
|
|
1715
|
+
stopped: z.ZodMiniOptional<z.ZodMiniIntersection<z.ZodMiniObject<{
|
|
1716
|
+
id: z.ZodMiniUUID;
|
|
1717
|
+
task_id: z.ZodMiniString<string>;
|
|
1718
|
+
started_at: z.ZodMiniString<string>;
|
|
1719
|
+
ended_at: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
1720
|
+
duration: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
|
|
1721
|
+
running: z.ZodMiniOptional<z.ZodMiniLiteral<true>>;
|
|
1722
|
+
discarded: z.ZodMiniOptional<z.ZodMiniLiteral<true>>;
|
|
1723
|
+
}, z.core.$strip>, z.ZodMiniUnknown>>;
|
|
1724
|
+
already_running: z.ZodMiniOptional<z.ZodMiniLiteral<true>>;
|
|
1725
|
+
}, z.core.$strip>;
|
|
1726
|
+
/**
|
|
1727
|
+
* Stopped
|
|
1728
|
+
*/
|
|
1729
|
+
declare const zStopTimerResponse: z.ZodMiniObject<{
|
|
1730
|
+
id: z.ZodMiniUUID;
|
|
1731
|
+
task_id: z.ZodMiniString<string>;
|
|
1732
|
+
started_at: z.ZodMiniString<string>;
|
|
1733
|
+
ended_at: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
1734
|
+
duration: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
|
|
1735
|
+
running: z.ZodMiniOptional<z.ZodMiniLiteral<true>>;
|
|
1736
|
+
discarded: z.ZodMiniOptional<z.ZodMiniLiteral<true>>;
|
|
1737
|
+
}, z.core.$strip>;
|
|
1738
|
+
declare const zUpdateTimerBody: z.ZodMiniObject<{
|
|
1739
|
+
started_at: z.ZodMiniOptional<z.iso.ZodMiniISODateTime>;
|
|
1740
|
+
ended_at: z.ZodMiniOptional<z.iso.ZodMiniISODateTime>;
|
|
1741
|
+
}, z.core.$strip>;
|
|
1742
|
+
declare const zUpdateTimerPath: z.ZodMiniObject<{
|
|
1743
|
+
timerId: z.ZodMiniUUID;
|
|
1744
|
+
}, z.core.$strip>;
|
|
1745
|
+
/**
|
|
1746
|
+
* Updated
|
|
1747
|
+
*/
|
|
1748
|
+
declare const zUpdateTimerResponse: z.ZodMiniObject<{
|
|
1749
|
+
id: z.ZodMiniUUID;
|
|
1750
|
+
task_id: z.ZodMiniString<string>;
|
|
1751
|
+
started_at: z.ZodMiniString<string>;
|
|
1752
|
+
ended_at: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
1753
|
+
duration: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
|
|
1754
|
+
running: z.ZodMiniOptional<z.ZodMiniLiteral<true>>;
|
|
1755
|
+
discarded: z.ZodMiniOptional<z.ZodMiniLiteral<true>>;
|
|
1756
|
+
}, z.core.$strip>;
|
|
1757
|
+
declare const zListTasksHistoryQuery: z.ZodMiniObject<{
|
|
1758
|
+
since: z.ZodMiniOptional<z.iso.ZodMiniISODateTime>;
|
|
1759
|
+
limit: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
|
|
1760
|
+
}, z.core.$strip>;
|
|
1761
|
+
/**
|
|
1762
|
+
* History
|
|
1763
|
+
*/
|
|
1764
|
+
declare const zListTasksHistoryResponse: z.ZodMiniArray<z.ZodMiniObject<{
|
|
1765
|
+
task_id: z.ZodMiniString<string>;
|
|
1766
|
+
action: z.ZodMiniString<string>;
|
|
1767
|
+
at: z.ZodMiniString<string>;
|
|
1768
|
+
old: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
1769
|
+
new: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
1770
|
+
reason: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
1771
|
+
actor: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
1772
|
+
encrypted: z.ZodMiniOptional<z.ZodMiniLiteral<true>>;
|
|
1773
|
+
}, z.core.$strip>>;
|
|
1774
|
+
declare const zListTaskHistoryPath: z.ZodMiniObject<{
|
|
1775
|
+
id: z.ZodMiniString<string>;
|
|
1776
|
+
}, z.core.$strip>;
|
|
1777
|
+
declare const zListTaskHistoryQuery: z.ZodMiniObject<{
|
|
1778
|
+
limit: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
|
|
1779
|
+
}, z.core.$strip>;
|
|
1780
|
+
/**
|
|
1781
|
+
* History
|
|
1782
|
+
*/
|
|
1783
|
+
declare const zListTaskHistoryResponse: z.ZodMiniArray<z.ZodMiniObject<{
|
|
1784
|
+
task_id: z.ZodMiniString<string>;
|
|
1785
|
+
action: z.ZodMiniString<string>;
|
|
1786
|
+
at: z.ZodMiniString<string>;
|
|
1787
|
+
old: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
1788
|
+
new: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
1789
|
+
reason: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
1790
|
+
actor: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
1791
|
+
encrypted: z.ZodMiniOptional<z.ZodMiniLiteral<true>>;
|
|
1792
|
+
}, z.core.$strip>>;
|
|
1012
1793
|
|
|
1013
1794
|
interface PerspecTaskOptions {
|
|
1014
1795
|
/**
|
|
1015
1796
|
* Your PerspecTask API key (begins with `pt_live_`). Create one in the web
|
|
1016
|
-
* app under **Account → API Keys**. Carries `tasks:read` / `tasks:write`
|
|
1797
|
+
* app under **Account → API Keys**. Carries `tasks:read` / `tasks:write`
|
|
1798
|
+
* scopes, `kpis:read` / `kpis:write` for KPIs, `timers:read` /
|
|
1799
|
+
* `timers:write` for time tracking and `history:read` for task history.
|
|
1017
1800
|
*
|
|
1018
1801
|
* Or a function returning a token, called before every request: that's how
|
|
1019
1802
|
* a `pt login` OAuth token is refreshed when it expires (see
|
|
@@ -1054,6 +1837,8 @@ declare class PerspecTask {
|
|
|
1054
1837
|
* is scoped to. Encrypted tasks are returned with `encrypted: true` and no title/description keys.
|
|
1055
1838
|
*/
|
|
1056
1839
|
readonly tasks: ReturnType<typeof createTasksNamespace>;
|
|
1840
|
+
/** Time tracking: the running timer, the list of work sessions, start, stop and edit. */
|
|
1841
|
+
readonly timers: ReturnType<typeof createTimersNamespace>;
|
|
1057
1842
|
constructor(options: PerspecTaskOptions);
|
|
1058
1843
|
}
|
|
1059
1844
|
declare function createTasksNamespace(client: Client): {
|
|
@@ -1141,6 +1926,153 @@ declare function createTasksNamespace(client: Client): {
|
|
|
1141
1926
|
response?: Response;
|
|
1142
1927
|
}>;
|
|
1143
1928
|
};
|
|
1929
|
+
/**
|
|
1930
|
+
* The read-only log of every change to your tasks (status, priority,
|
|
1931
|
+
* deadline, parents, title, description). Needs the `history:read` scope.
|
|
1932
|
+
*/
|
|
1933
|
+
history: {
|
|
1934
|
+
/** Every change across your plaintext tasks, newest first (`{ since, limit }`). Wraps `Tasks.listTasksHistory`. */
|
|
1935
|
+
list: (query?: ListTasksHistoryData["query"]) => Promise<({
|
|
1936
|
+
data: undefined;
|
|
1937
|
+
error: unknown;
|
|
1938
|
+
} | {
|
|
1939
|
+
data: HistoryEntry[];
|
|
1940
|
+
error: undefined;
|
|
1941
|
+
}) & {
|
|
1942
|
+
request?: Request;
|
|
1943
|
+
response?: Response;
|
|
1944
|
+
}>;
|
|
1945
|
+
/** Every change to one task, newest first (`{ limit }`). Wraps `Tasks.listTaskHistory`. */
|
|
1946
|
+
get: (id: string, query?: ListTaskHistoryData["query"]) => Promise<({
|
|
1947
|
+
data: HistoryEntry[];
|
|
1948
|
+
error: undefined;
|
|
1949
|
+
} | {
|
|
1950
|
+
data: undefined;
|
|
1951
|
+
error: unknown;
|
|
1952
|
+
}) & {
|
|
1953
|
+
request?: Request;
|
|
1954
|
+
response?: Response;
|
|
1955
|
+
}>;
|
|
1956
|
+
};
|
|
1957
|
+
/**
|
|
1958
|
+
* A task's KPI: `target` entries (the number to reach, optionally by a
|
|
1959
|
+
* date) and `actual` entries (readings over time). Needs the `kpis:read` /
|
|
1960
|
+
* `kpis:write` scopes.
|
|
1961
|
+
*/
|
|
1962
|
+
kpis: {
|
|
1963
|
+
/** Short ids of the tasks that have KPI entries. Wraps `Kpis.listKpiTasks`. */
|
|
1964
|
+
listTasks: () => Promise<({
|
|
1965
|
+
data: undefined;
|
|
1966
|
+
error: unknown;
|
|
1967
|
+
} | {
|
|
1968
|
+
data: string[];
|
|
1969
|
+
error: undefined;
|
|
1970
|
+
}) & {
|
|
1971
|
+
request?: Request;
|
|
1972
|
+
response?: Response;
|
|
1973
|
+
}>;
|
|
1974
|
+
/** The task's entries, oldest first. Wraps `Kpis.listTaskKpis`. */
|
|
1975
|
+
list: (id: string) => Promise<({
|
|
1976
|
+
data: KpiEntry[];
|
|
1977
|
+
error: undefined;
|
|
1978
|
+
} | {
|
|
1979
|
+
data: undefined;
|
|
1980
|
+
error: unknown;
|
|
1981
|
+
}) & {
|
|
1982
|
+
request?: Request;
|
|
1983
|
+
response?: Response;
|
|
1984
|
+
}>;
|
|
1985
|
+
/** Add a target or an actual (`at` required for an actual). Wraps `Kpis.createTaskKpi`. */
|
|
1986
|
+
create: (id: string, body: CreateTaskKpiData["body"]) => Promise<({
|
|
1987
|
+
data: KpiEntry;
|
|
1988
|
+
error: undefined;
|
|
1989
|
+
} | {
|
|
1990
|
+
data: undefined;
|
|
1991
|
+
error: unknown;
|
|
1992
|
+
}) & {
|
|
1993
|
+
request?: Request;
|
|
1994
|
+
response?: Response;
|
|
1995
|
+
}>;
|
|
1996
|
+
/** Change an entry's kind, value or at (`at: null` drops a target's date). Wraps `Kpis.updateTaskKpi`. */
|
|
1997
|
+
update: (id: string, kpiId: string, body: UpdateTaskKpiData["body"]) => Promise<({
|
|
1998
|
+
data: KpiEntry;
|
|
1999
|
+
error: undefined;
|
|
2000
|
+
} | {
|
|
2001
|
+
data: undefined;
|
|
2002
|
+
error: unknown;
|
|
2003
|
+
}) & {
|
|
2004
|
+
request?: Request;
|
|
2005
|
+
response?: Response;
|
|
2006
|
+
}>;
|
|
2007
|
+
/** Delete an entry by its `id` from `list`. Wraps `Kpis.deleteTaskKpi`. */
|
|
2008
|
+
delete: (id: string, kpiId: string) => Promise<({
|
|
2009
|
+
data: void;
|
|
2010
|
+
error: undefined;
|
|
2011
|
+
} | {
|
|
2012
|
+
data: undefined;
|
|
2013
|
+
error: unknown;
|
|
2014
|
+
}) & {
|
|
2015
|
+
request?: Request;
|
|
2016
|
+
response?: Response;
|
|
2017
|
+
}>;
|
|
2018
|
+
};
|
|
2019
|
+
};
|
|
2020
|
+
declare function createTimersNamespace(client: Client): {
|
|
2021
|
+
/** The running timer and the seconds worked today (`{ day_start }` = the user's local midnight). Wraps `Timers.getTimerStatus`. */
|
|
2022
|
+
status: (query?: GetTimerStatusData["query"]) => Promise<({
|
|
2023
|
+
data: undefined;
|
|
2024
|
+
error: unknown;
|
|
2025
|
+
} | {
|
|
2026
|
+
data: TimerStatus;
|
|
2027
|
+
error: undefined;
|
|
2028
|
+
}) & {
|
|
2029
|
+
request?: Request;
|
|
2030
|
+
response?: Response;
|
|
2031
|
+
}>;
|
|
2032
|
+
/** Work sessions, newest first (`{ task_id, since, limit }`). Wraps `Timers.listTimers`. */
|
|
2033
|
+
list: (query?: ListTimersData["query"]) => Promise<({
|
|
2034
|
+
data: Timer[];
|
|
2035
|
+
error: undefined;
|
|
2036
|
+
} | {
|
|
2037
|
+
data: undefined;
|
|
2038
|
+
error: unknown;
|
|
2039
|
+
}) & {
|
|
2040
|
+
request?: Request;
|
|
2041
|
+
response?: Response;
|
|
2042
|
+
}>;
|
|
2043
|
+
/** Start a timer on a task; a timer running elsewhere is stopped first. Wraps `Timers.startTaskTimer`. */
|
|
2044
|
+
start: (taskId: string) => Promise<({
|
|
2045
|
+
data: StartTimerResponse;
|
|
2046
|
+
error: undefined;
|
|
2047
|
+
} | {
|
|
2048
|
+
data: undefined;
|
|
2049
|
+
error: unknown;
|
|
2050
|
+
}) & {
|
|
2051
|
+
request?: Request;
|
|
2052
|
+
response?: Response;
|
|
2053
|
+
}>;
|
|
2054
|
+
/** Stop the running timer. Wraps `Timers.stopTimer`. */
|
|
2055
|
+
stop: () => Promise<({
|
|
2056
|
+
data: Timer;
|
|
2057
|
+
error: undefined;
|
|
2058
|
+
} | {
|
|
2059
|
+
data: undefined;
|
|
2060
|
+
error: unknown;
|
|
2061
|
+
}) & {
|
|
2062
|
+
request?: Request;
|
|
2063
|
+
response?: Response;
|
|
2064
|
+
}>;
|
|
2065
|
+
/** Change a finished timer's `started_at` and/or `ended_at`. Wraps `Timers.updateTimer`. */
|
|
2066
|
+
update: (timerId: string, body: UpdateTimerData["body"]) => Promise<({
|
|
2067
|
+
data: Timer;
|
|
2068
|
+
error: undefined;
|
|
2069
|
+
} | {
|
|
2070
|
+
data: undefined;
|
|
2071
|
+
error: unknown;
|
|
2072
|
+
}) & {
|
|
2073
|
+
request?: Request;
|
|
2074
|
+
response?: Response;
|
|
2075
|
+
}>;
|
|
1144
2076
|
};
|
|
1145
2077
|
|
|
1146
|
-
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 };
|
|
2078
|
+
export { type ClientOptions, type CreateTaskData, type CreateTaskKpiData, type CreateTaskKpiErrors, type CreateTaskKpiResponse, type CreateTaskKpiResponses, type CreateTaskResponse, type CreateTaskResponses, type DeleteTaskKpiData, type DeleteTaskKpiErrors, type DeleteTaskKpiResponse, type DeleteTaskKpiResponses, type GetTaskData, type GetTaskErrors, type GetTaskResponse, type GetTaskResponses, type GetTimerStatusData, type GetTimerStatusResponse, type GetTimerStatusResponses, type HistoryEntry, type KpiEntry, Kpis, type LinkTaskPullRequestData, type LinkTaskPullRequestErrors, type LinkTaskPullRequestResponse, type LinkTaskPullRequestResponses, type ListKpiTasksData, type ListKpiTasksResponse, type ListKpiTasksResponses, type ListTaskHistoryData, type ListTaskHistoryErrors, type ListTaskHistoryResponse, type ListTaskHistoryResponses, type ListTaskKpisData, type ListTaskKpisErrors, type ListTaskKpisResponse, type ListTaskKpisResponses, type ListTaskPullRequestsData, type ListTaskPullRequestsErrors, type ListTaskPullRequestsResponse, type ListTaskPullRequestsResponses, type ListTasksData, type ListTasksHistoryData, type ListTasksHistoryResponse, type ListTasksHistoryResponses, type ListTasksResponse, type ListTasksResponses, type ListTimersData, type ListTimersErrors, type ListTimersResponse, type ListTimersResponses, type Options, PerspecTask, type PerspecTaskOptions, type PullRequest, PullRequests, type StartTaskTimerData, type StartTaskTimerErrors, type StartTaskTimerResponse, type StartTaskTimerResponses, type StartTimerResponse, type StopTimerData, type StopTimerErrors, type StopTimerResponse, type StopTimerResponses, type Task, Tasks, type Timer, type TimerStatus, Timers, type UnlinkTaskPullRequestData, type UnlinkTaskPullRequestErrors, type UnlinkTaskPullRequestResponse, type UnlinkTaskPullRequestResponses, type UpdateTaskData, type UpdateTaskErrors, type UpdateTaskKpiData, type UpdateTaskKpiErrors, type UpdateTaskKpiResponse, type UpdateTaskKpiResponses, type UpdateTaskResponse, type UpdateTaskResponses, type UpdateTimerData, type UpdateTimerErrors, type UpdateTimerResponse, type UpdateTimerResponses, PerspecTask as default, zCreateTaskBody, zCreateTaskKpiBody, zCreateTaskKpiPath, zCreateTaskKpiResponse, zCreateTaskResponse, zDeleteTaskKpiPath, zDeleteTaskKpiResponse, zGetTaskPath, zGetTaskQuery, zGetTaskResponse, zGetTimerStatusQuery, zGetTimerStatusResponse, zHistoryEntry, zKpiEntry, zLinkTaskPullRequestBody, zLinkTaskPullRequestPath, zLinkTaskPullRequestResponse, zListKpiTasksResponse, zListTaskHistoryPath, zListTaskHistoryQuery, zListTaskHistoryResponse, zListTaskKpisPath, zListTaskKpisResponse, zListTaskPullRequestsPath, zListTaskPullRequestsResponse, zListTasksHistoryQuery, zListTasksHistoryResponse, zListTasksQuery, zListTasksResponse, zListTimersQuery, zListTimersResponse, zPullRequest, zStartTaskTimerPath, zStartTaskTimerResponse, zStartTimerResponse, zStopTimerResponse, zTask, zTimer, zTimerStatus, zUnlinkTaskPullRequestPath, zUnlinkTaskPullRequestResponse, zUpdateTaskBody, zUpdateTaskKpiBody, zUpdateTaskKpiPath, zUpdateTaskKpiResponse, zUpdateTaskPath, zUpdateTaskResponse, zUpdateTimerBody, zUpdateTimerPath, zUpdateTimerResponse };
|