@doist/todoist-api-typescript 7.3.0 → 7.5.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.
Files changed (59) hide show
  1. package/README.md +2 -0
  2. package/dist/cjs/authentication.js +14 -4
  3. package/dist/cjs/consts/endpoints.js +11 -1
  4. package/dist/cjs/test-utils/asserts.js +1 -1
  5. package/dist/cjs/test-utils/test-defaults.js +33 -1
  6. package/dist/cjs/todoist-api.js +532 -88
  7. package/dist/cjs/{utils → transport}/fetch-with-retry.js +23 -71
  8. package/dist/cjs/{rest-client.js → transport/http-client.js} +6 -6
  9. package/dist/cjs/transport/http-dispatcher.js +72 -0
  10. package/dist/cjs/types/entities.js +11 -1
  11. package/dist/cjs/types/errors.js +9 -2
  12. package/dist/cjs/types/http.js +3 -1
  13. package/dist/cjs/types/requests.js +3 -0
  14. package/dist/cjs/types/sync/commands/labels.js +3 -0
  15. package/dist/cjs/types/sync/commands/shared.js +15 -0
  16. package/dist/cjs/types/sync/resources/reminders.js +2 -0
  17. package/dist/cjs/types/sync/user-preferences.js +27 -7
  18. package/dist/cjs/utils/multipart-upload.js +1 -1
  19. package/dist/cjs/utils/sanitization.js +7 -7
  20. package/dist/esm/authentication.js +10 -1
  21. package/dist/esm/consts/endpoints.js +9 -0
  22. package/dist/esm/test-utils/asserts.js +1 -1
  23. package/dist/esm/test-utils/test-defaults.js +32 -0
  24. package/dist/esm/todoist-api.js +467 -23
  25. package/dist/esm/{utils → transport}/fetch-with-retry.js +23 -38
  26. package/dist/esm/{rest-client.js → transport/http-client.js} +6 -6
  27. package/dist/esm/transport/http-dispatcher.js +35 -0
  28. package/dist/esm/types/entities.js +10 -0
  29. package/dist/esm/types/errors.js +7 -1
  30. package/dist/esm/types/http.js +3 -1
  31. package/dist/esm/types/requests.js +2 -1
  32. package/dist/esm/types/sync/commands/labels.js +2 -1
  33. package/dist/esm/types/sync/commands/shared.js +13 -1
  34. package/dist/esm/types/sync/resources/reminders.js +2 -0
  35. package/dist/esm/types/sync/user-preferences.js +23 -3
  36. package/dist/esm/utils/multipart-upload.js +1 -1
  37. package/dist/esm/utils/sanitization.js +7 -7
  38. package/dist/types/authentication.d.ts +5 -3
  39. package/dist/types/consts/endpoints.d.ts +9 -0
  40. package/dist/types/test-utils/test-defaults.d.ts +5 -1
  41. package/dist/types/todoist-api.d.ts +144 -3
  42. package/dist/types/{utils → transport}/fetch-with-retry.d.ts +1 -1
  43. package/dist/types/{rest-client.d.ts → transport/http-client.d.ts} +1 -1
  44. package/dist/types/transport/http-dispatcher.d.ts +3 -0
  45. package/dist/types/types/entities.d.ts +8 -1
  46. package/dist/types/types/errors.d.ts +4 -0
  47. package/dist/types/types/requests.d.ts +163 -1
  48. package/dist/types/types/sync/commands/labels.d.ts +5 -1
  49. package/dist/types/types/sync/commands/projects.d.ts +2 -2
  50. package/dist/types/types/sync/commands/reminders.d.ts +3 -2
  51. package/dist/types/types/sync/commands/shared.d.ts +10 -5
  52. package/dist/types/types/sync/resources/reminders.d.ts +4 -0
  53. package/dist/types/types/sync/resources/user.d.ts +2 -2
  54. package/dist/types/types/sync/user-preferences.d.ts +30 -4
  55. package/dist/types/utils/validators.d.ts +4 -0
  56. package/package.json +10 -17
  57. package/dist/cjs/test-utils/mocks.js +0 -3
  58. package/dist/esm/test-utils/mocks.js +0 -3
  59. package/dist/types/test-utils/mocks.d.ts +0 -0
@@ -353,10 +353,13 @@ export type PersonalProject = z.infer<typeof PersonalProjectSchema>;
353
353
  * @see https://todoist.com/api/v1/docs#tag/Projects
354
354
  */
355
355
  export type WorkspaceProject = z.infer<typeof WorkspaceProjectSchema>;
356
+ /** Available project view styles. */
357
+ export declare const PROJECT_VIEW_STYLES: readonly ["list", "board", "calendar"];
356
358
  /**
359
+ * View style for a project.
357
360
  * @see https://todoist.com/api/v1/docs#tag/Projects
358
361
  */
359
- export type ProjectViewStyle = 'list' | 'board' | 'calendar';
362
+ export type ProjectViewStyle = (typeof PROJECT_VIEW_STYLES)[number];
360
363
  export declare const SectionSchema: z.ZodPipe<z.ZodObject<{
361
364
  id: z.ZodString;
362
365
  userId: z.ZodString;
@@ -778,6 +781,10 @@ export declare const ActivityEventSchema: z.ZodObject<{
778
781
  * Represents an activity log event in Todoist.
779
782
  */
780
783
  export type ActivityEvent = z.infer<typeof ActivityEventSchema>;
784
+ /** Available project collaborator roles. */
785
+ export declare const COLLABORATOR_ROLES: readonly ["CREATOR", "ADMIN", "READ_WRITE", "EDIT_ONLY", "COMPLETE_ONLY"];
786
+ /** Role of a collaborator in a project. */
787
+ export type CollaboratorRole = (typeof COLLABORATOR_ROLES)[number];
781
788
  /**
782
789
  * Available workspace roles.
783
790
  */
@@ -6,3 +6,7 @@ export declare class TodoistRequestError extends CustomError {
6
6
  constructor(message: string, httpStatusCode?: number | undefined, responseData?: unknown | undefined);
7
7
  isAuthenticationError: () => boolean;
8
8
  }
9
+ export declare class TodoistArgumentError extends CustomError {
10
+ message: string;
11
+ constructor(message: string);
12
+ }
@@ -1,6 +1,7 @@
1
1
  import type { RequireAllOrNone, RequireOneOrNone, RequireExactlyOne } from 'type-fest';
2
2
  import type { ColorKey } from '../utils/colors.js';
3
- import type { ActivityEvent, ActivityObjectEventType, Comment, Duration, Label, PersonalProject, ProjectViewStyle, ProjectVisibility, Section, Task, User, WorkspaceProject } from './entities.js';
3
+ import type { ActivityEvent, ActivityObjectEventType, CollaboratorRole, Comment, DueDate, Duration, Label, PersonalProject, ProjectViewStyle, ProjectVisibility, Section, Task, User, WorkspaceProject, WorkspaceRole } from './entities.js';
4
+ import type { LocationTrigger } from './sync/resources/reminders.js';
4
5
  /**
5
6
  * Arguments for creating a new task.
6
7
  * @see https://todoist.com/api/v1/docs#tag/Tasks/operation/create_task_api_v1_tasks_post
@@ -417,6 +418,56 @@ export type AddCommentArgs = {
417
418
  export type UpdateCommentArgs = {
418
419
  content: string;
419
420
  };
421
+ /** Available reminder delivery services. */
422
+ export declare const REMINDER_DELIVERY_SERVICES: readonly ["email", "push"];
423
+ /** Delivery service for a reminder notification. */
424
+ export type ReminderDeliveryService = (typeof REMINDER_DELIVERY_SERVICES)[number];
425
+ export type ReminderDueDate = Partial<Pick<DueDate, 'date' | 'string' | 'timezone' | 'lang' | 'isRecurring'>>;
426
+ type ReminderTaskArgs = {
427
+ taskId: string;
428
+ };
429
+ type TimeBasedReminderArgs = {
430
+ service?: ReminderDeliveryService;
431
+ notifyUid?: string;
432
+ isUrgent?: boolean;
433
+ };
434
+ type AddLocationReminderFields = {
435
+ notifyUid?: string;
436
+ name: string;
437
+ locLat: string;
438
+ locLong: string;
439
+ locTrigger: LocationTrigger;
440
+ radius?: number;
441
+ };
442
+ export type AddRelativeReminderArgs = ReminderTaskArgs & {
443
+ reminderType?: 'relative';
444
+ minuteOffset: number;
445
+ } & TimeBasedReminderArgs;
446
+ export type AddAbsoluteReminderArgs = ReminderTaskArgs & {
447
+ reminderType: 'absolute';
448
+ due: ReminderDueDate;
449
+ } & TimeBasedReminderArgs;
450
+ export type AddLocationReminderArgs = ReminderTaskArgs & AddLocationReminderFields;
451
+ /**
452
+ * Arguments for creating a new reminder.
453
+ * @see https://developer.todoist.com/api/v1/#tag/Reminders/operation/create_reminder_api_v1_reminders_post
454
+ */
455
+ export type AddReminderArgs = AddRelativeReminderArgs | AddAbsoluteReminderArgs;
456
+ export type UpdateRelativeReminderArgs = {
457
+ reminderType: 'relative';
458
+ } & Partial<Omit<AddRelativeReminderArgs, 'taskId' | 'reminderType'>>;
459
+ export type UpdateAbsoluteReminderArgs = {
460
+ reminderType: 'absolute';
461
+ } & Partial<Omit<AddAbsoluteReminderArgs, 'taskId' | 'reminderType'>>;
462
+ /**
463
+ * Arguments for updating an existing reminder.
464
+ * @see https://developer.todoist.com/api/v1/#tag/Reminders/operation/update_reminder_api_v1_reminders__reminder_id__post
465
+ */
466
+ export type UpdateReminderArgs = UpdateRelativeReminderArgs | UpdateAbsoluteReminderArgs;
467
+ /**
468
+ * Arguments for updating an existing location reminder.
469
+ */
470
+ export type UpdateLocationReminderArgs = Partial<Omit<AddLocationReminderArgs, 'taskId'>>;
420
471
  /**
421
472
  * Common arguments for retrieving activity logs (excluding filter-type params).
422
473
  */
@@ -554,6 +605,117 @@ export type MoveProjectToPersonalArgs = {
554
605
  /** The ID of the project to move. */
555
606
  projectId: string;
556
607
  };
608
+ /**
609
+ * Arguments for counting archived projects.
610
+ * @see https://todoist.com/api/v1/docs#tag/Projects/operation/count_projects_archived_api_v1_projects_archived_count_get
611
+ */
612
+ export type GetArchivedProjectsCountArgs = {
613
+ workspaceId?: number | null;
614
+ joined?: boolean | null;
615
+ };
616
+ /**
617
+ * Response from counting archived projects.
618
+ * @see https://todoist.com/api/v1/docs#tag/Projects/operation/count_projects_archived_api_v1_projects_archived_count_get
619
+ */
620
+ export type GetArchivedProjectsCountResponse = {
621
+ count: number;
622
+ };
623
+ /**
624
+ * An action permitted for a role.
625
+ */
626
+ export type ActionView = {
627
+ name: string;
628
+ };
629
+ /**
630
+ * A project collaborator role with its permitted actions.
631
+ */
632
+ export type ProjectRoleView = {
633
+ name: CollaboratorRole;
634
+ actions: ActionView[];
635
+ };
636
+ /**
637
+ * A workspace role with its permitted actions.
638
+ */
639
+ export type WorkspaceRoleView = {
640
+ name: WorkspaceRole;
641
+ actions: ActionView[];
642
+ };
643
+ /**
644
+ * Response from getting project permissions (role-to-action mappings).
645
+ * @see https://todoist.com/api/v1/docs#tag/Projects/operation/permissions_api_v1_projects_permissions_get
646
+ */
647
+ export type GetProjectPermissionsResponse = {
648
+ projectCollaboratorActions: ProjectRoleView[];
649
+ workspaceCollaboratorActions: WorkspaceRoleView[];
650
+ };
651
+ /**
652
+ * Arguments for getting full project data.
653
+ * @see https://todoist.com/api/v1/docs#tag/Projects/operation/projects_full_data_api_v1_projects__project_id__full_get
654
+ */
655
+ export type GetFullProjectArgs = {
656
+ /**
657
+ * Required to access the public project without authentication.
658
+ */
659
+ publicKey?: string | null;
660
+ };
661
+ /**
662
+ * Response from getting full project data.
663
+ * @see https://todoist.com/api/v1/docs#tag/Projects/operation/projects_full_data_api_v1_projects__project_id__full_get
664
+ */
665
+ export type GetFullProjectResponse = {
666
+ project: (PersonalProject | WorkspaceProject) | null;
667
+ commentsCount: number;
668
+ tasks: Task[];
669
+ sections: Section[];
670
+ collaborators: User[];
671
+ notes: Comment[];
672
+ };
673
+ /**
674
+ * Arguments for creating a new workspace.
675
+ * @see https://todoist.com/api/v1/docs#tag/Workspace/operation/create_workspace_api_v1_workspaces_post
676
+ */
677
+ export type AddWorkspaceArgs = {
678
+ /** Name of the workspace. */
679
+ name: string;
680
+ /** Description of the workspace. */
681
+ description?: string | null;
682
+ /** Whether link sharing is enabled for the workspace. */
683
+ isLinkSharingEnabled?: boolean;
684
+ /** Whether guests are allowed in the workspace. */
685
+ isGuestAllowed?: boolean;
686
+ /** Workspace email domain. */
687
+ domainName?: string | null;
688
+ /** Whether users with matching email domains can discover this workspace. */
689
+ domainDiscovery?: boolean;
690
+ /** Whether workspace invites are restricted to workspace domain. */
691
+ restrictEmailDomains?: boolean;
692
+ /** Workspace properties. */
693
+ properties?: Record<string, unknown> | null;
694
+ };
695
+ /**
696
+ * Arguments for updating an existing workspace.
697
+ * @see https://todoist.com/api/v1/docs#tag/Workspace/operation/update_workspace_api_v1_workspaces__workspace_id__post
698
+ */
699
+ export type UpdateWorkspaceArgs = {
700
+ /** Updated workspace name. */
701
+ name?: string;
702
+ /** Updated workspace description. */
703
+ description?: string | null;
704
+ /** Updated link sharing status. */
705
+ isLinkSharingEnabled?: boolean;
706
+ /** Updated guest access status. */
707
+ isGuestAllowed?: boolean | null;
708
+ /** Updated workspace email domain. */
709
+ domainName?: string | null;
710
+ /** Updated domain discovery setting. */
711
+ domainDiscovery?: boolean;
712
+ /** Updated email domain restriction setting. */
713
+ restrictEmailDomains?: boolean;
714
+ /** Updated workspace properties. */
715
+ properties?: Record<string, unknown> | null;
716
+ /** Updated collapse state for current user. */
717
+ isCollapsed?: boolean;
718
+ };
557
719
  /**
558
720
  * Arguments for getting workspace invitations.
559
721
  */
@@ -19,9 +19,13 @@ export type LabelUpdateArgs = {
19
19
  export type LabelUpdateOrdersArgs = {
20
20
  idOrderMapping: Record<string, number>;
21
21
  };
22
+ /** Available label delete cascade modes. */
23
+ export declare const LABEL_DELETE_CASCADE_MODES: readonly ["none", "all"];
24
+ /** Cascade mode when deleting a label. */
25
+ export type LabelDeleteCascadeMode = (typeof LABEL_DELETE_CASCADE_MODES)[number];
22
26
  export type LabelDeleteArgs = {
23
27
  id: string;
24
- cascade?: 'none' | 'all';
28
+ cascade?: LabelDeleteCascadeMode;
25
29
  };
26
30
  export type LabelDeleteOccurrencesArgs = {
27
31
  name: string;
@@ -1,5 +1,5 @@
1
- import type { ProjectViewStyle, ProjectVisibility, WorkspaceRole } from '../../entities.js';
2
- import type { ProjectStatus, CollaboratorRole } from './shared.js';
1
+ import type { ProjectViewStyle, ProjectVisibility, WorkspaceRole, CollaboratorRole } from '../../entities.js';
2
+ import type { ProjectStatus } from './shared.js';
3
3
  import type { ColorKey } from '../../../utils/colors.js';
4
4
  export type ProjectAccessConfig = {
5
5
  visibility: ProjectVisibility;
@@ -1,4 +1,5 @@
1
1
  import type { SyncDueDate, ReminderService } from './shared.js';
2
+ import type { LocationTrigger } from '../resources/reminders.js';
2
3
  export type ReminderAddArgs = {
3
4
  type: 'absolute';
4
5
  itemId: string;
@@ -19,7 +20,7 @@ export type ReminderAddArgs = {
19
20
  locLat: string;
20
21
  locLong: string;
21
22
  radius?: number;
22
- locTrigger?: 'on_enter' | 'on_leave';
23
+ locTrigger?: LocationTrigger;
23
24
  notifyUid?: string;
24
25
  };
25
26
  export type ReminderUpdateArgs = {
@@ -42,7 +43,7 @@ export type ReminderUpdateArgs = {
42
43
  locLat?: string;
43
44
  locLong?: string;
44
45
  radius?: number;
45
- locTrigger?: 'on_enter' | 'on_leave';
46
+ locTrigger?: LocationTrigger;
46
47
  notifyUid?: string;
47
48
  };
48
49
  export type ReminderDeleteArgs = {
@@ -31,16 +31,21 @@ export type SyncDuration = {
31
31
  } | null;
32
32
  /** Task priority: 1 = normal, 2 = medium, 3 = high, 4 = urgent. */
33
33
  export type TaskPriority = 1 | 2 | 3 | 4;
34
+ /** Available project workflow statuses. */
35
+ export declare const PROJECT_STATUSES: readonly ["PLANNED", "IN_PROGRESS", "PAUSED", "COMPLETED", "CANCELED"];
34
36
  /** Project workflow status. */
35
- export type ProjectStatus = 'PLANNED' | 'IN_PROGRESS' | 'PAUSED' | 'COMPLETED' | 'CANCELED';
36
- /** Default collaborator role for a project. */
37
- export type CollaboratorRole = 'CREATOR' | 'ADMIN' | 'READ_WRITE' | 'EDIT_ONLY' | 'COMPLETE_ONLY';
37
+ export type ProjectStatus = (typeof PROJECT_STATUSES)[number];
38
+ export { COLLABORATOR_ROLES, type CollaboratorRole } from '../../entities.js';
39
+ /** Available reminder notification services. */
40
+ export declare const REMINDER_SERVICES: readonly ["default", "email", "mobile", "push", "no_default"];
38
41
  /** Reminder notification service. */
39
- export type ReminderService = 'default' | 'email' | 'mobile' | 'push' | 'no_default';
42
+ export type ReminderService = (typeof REMINDER_SERVICES)[number];
40
43
  /**
41
44
  * Default access level for workspaces.
42
45
  * Same values as {@link ProjectVisibility} from entities.
43
46
  */
44
47
  export { type ProjectVisibility as DefaultAccessLevel } from '../../entities.js';
48
+ /** Available workspace project sort orders. */
49
+ export declare const WORKSPACE_PROJECT_SORT_ORDERS: readonly ["MANUAL", "A_TO_Z", "Z_TO_A"];
45
50
  /** Workspace project sort order preference. */
46
- export type WorkspaceProjectSortOrder = 'MANUAL' | 'A_TO_Z' | 'Z_TO_A';
51
+ export type WorkspaceProjectSortOrder = (typeof WORKSPACE_PROJECT_SORT_ORDERS)[number];
@@ -42,6 +42,7 @@ export declare const AbsoluteReminderSchema: z.ZodObject<{
42
42
  timezone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
43
43
  lang: z.ZodOptional<z.ZodNullable<z.ZodString>>;
44
44
  }, z.core.$strip>;
45
+ isUrgent: z.ZodOptional<z.ZodBoolean>;
45
46
  }, z.core.$loose>;
46
47
  export type AbsoluteReminder = z.infer<typeof AbsoluteReminderSchema>;
47
48
  export declare const RelativeReminderSchema: z.ZodObject<{
@@ -60,6 +61,7 @@ export declare const RelativeReminderSchema: z.ZodObject<{
60
61
  timezone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
61
62
  lang: z.ZodOptional<z.ZodNullable<z.ZodString>>;
62
63
  }, z.core.$strip>>;
64
+ isUrgent: z.ZodOptional<z.ZodBoolean>;
63
65
  }, z.core.$loose>;
64
66
  export type RelativeReminder = z.infer<typeof RelativeReminderSchema>;
65
67
  export declare const ReminderSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -92,6 +94,7 @@ export declare const ReminderSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
92
94
  timezone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
93
95
  lang: z.ZodOptional<z.ZodNullable<z.ZodString>>;
94
96
  }, z.core.$strip>;
97
+ isUrgent: z.ZodOptional<z.ZodBoolean>;
95
98
  }, z.core.$loose>, z.ZodObject<{
96
99
  id: z.ZodString;
97
100
  notifyUid: z.ZodString;
@@ -108,5 +111,6 @@ export declare const ReminderSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
108
111
  timezone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
109
112
  lang: z.ZodOptional<z.ZodNullable<z.ZodString>>;
110
113
  }, z.core.$strip>>;
114
+ isUrgent: z.ZodOptional<z.ZodBoolean>;
111
115
  }, z.core.$loose>], "type">;
112
116
  export type Reminder = z.infer<typeof ReminderSchema>;
@@ -89,7 +89,7 @@ export declare const SyncUserSchema: z.ZodObject<{
89
89
  mfaEnabled: z.ZodOptional<z.ZodBoolean>;
90
90
  mobileHost: z.ZodNullable<z.ZodString>;
91
91
  mobileNumber: z.ZodNullable<z.ZodString>;
92
- nextWeek: z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>, z.ZodLiteral<6>, z.ZodLiteral<7>]>, z.ZodTransform<"Monday" | "Tuesday" | "Wednesday" | "Thursday" | "Friday" | "Saturday" | "Sunday", 2 | 1 | 3 | 4 | 5 | 6 | 7>>;
92
+ nextWeek: z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>, z.ZodLiteral<6>, z.ZodLiteral<7>]>, z.ZodTransform<"Monday" | "Tuesday" | "Wednesday" | "Thursday" | "Friday" | "Saturday" | "Sunday", 2 | 1 | 3 | 4 | 5 | 7 | 6>>;
93
93
  onboardingLevel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
94
94
  onboardingRole: z.ZodOptional<z.ZodNullable<z.ZodString>>;
95
95
  onboardingPersona: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -113,7 +113,7 @@ export declare const SyncUserSchema: z.ZodObject<{
113
113
  }, z.core.$strip>>>;
114
114
  shareLimit: z.ZodNumber;
115
115
  sortOrder: z.ZodNumber;
116
- startDay: z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>, z.ZodLiteral<6>, z.ZodLiteral<7>]>, z.ZodTransform<"Monday" | "Tuesday" | "Wednesday" | "Thursday" | "Friday" | "Saturday" | "Sunday", 2 | 1 | 3 | 4 | 5 | 6 | 7>>;
116
+ startDay: z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>, z.ZodLiteral<6>, z.ZodLiteral<7>]>, z.ZodTransform<"Monday" | "Tuesday" | "Wednesday" | "Thursday" | "Friday" | "Saturday" | "Sunday", 2 | 1 | 3 | 4 | 5 | 7 | 6>>;
117
117
  startPage: z.ZodString;
118
118
  themeId: z.ZodString;
119
119
  timeFormat: z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>]>, z.ZodTransform<"24h" | "12h", 0 | 1>>;
@@ -1,7 +1,33 @@
1
1
  import { z } from 'zod';
2
- export type DateFormat = 'DD/MM/YYYY' | 'MM/DD/YYYY';
3
- export type TimeFormat = '24h' | '12h';
4
- export type DayOfWeek = 'Monday' | 'Tuesday' | 'Wednesday' | 'Thursday' | 'Friday' | 'Saturday' | 'Sunday';
2
+ /** Available date format options. */
3
+ export declare const DATE_FORMATS: readonly ["DD/MM/YYYY", "MM/DD/YYYY"];
4
+ /** User date format preference. */
5
+ export type DateFormat = (typeof DATE_FORMATS)[number];
6
+ /** Available time format options. */
7
+ export declare const TIME_FORMATS: readonly ["24h", "12h"];
8
+ /** User time format preference. */
9
+ export type TimeFormat = (typeof TIME_FORMATS)[number];
10
+ /** Available days of the week. */
11
+ export declare const DAYS_OF_WEEK: readonly ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"];
12
+ /** Day of the week. */
13
+ export type DayOfWeek = (typeof DAYS_OF_WEEK)[number];
14
+ export declare const DATE_FORMAT_FROM_API: {
15
+ readonly 0: "DD/MM/YYYY";
16
+ readonly 1: "MM/DD/YYYY";
17
+ };
18
+ export declare const TIME_FORMAT_FROM_API: {
19
+ readonly 0: "24h";
20
+ readonly 1: "12h";
21
+ };
22
+ export declare const DAY_OF_WEEK_FROM_API: {
23
+ readonly 1: "Monday";
24
+ readonly 2: "Tuesday";
25
+ readonly 3: "Wednesday";
26
+ readonly 4: "Thursday";
27
+ readonly 5: "Friday";
28
+ readonly 6: "Saturday";
29
+ readonly 7: "Sunday";
30
+ };
5
31
  export declare const DATE_FORMAT_TO_API: Record<DateFormat, 0 | 1>;
6
32
  export declare const TIME_FORMAT_TO_API: Record<TimeFormat, 0 | 1>;
7
33
  export declare const DAY_OF_WEEK_TO_API: Record<DayOfWeek, 1 | 2 | 3 | 4 | 5 | 6 | 7>;
@@ -10,4 +36,4 @@ export declare const BooleanFromZeroOneSchema: z.ZodPipe<z.ZodUnion<readonly [z.
10
36
  /** Zod read-schemas: parse API numbers, emit descriptive strings */
11
37
  export declare const DateFormatSchema: z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>]>, z.ZodTransform<"DD/MM/YYYY" | "MM/DD/YYYY", 0 | 1>>;
12
38
  export declare const TimeFormatSchema: z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>]>, z.ZodTransform<"24h" | "12h", 0 | 1>>;
13
- export declare const DayOfWeekSchema: z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>, z.ZodLiteral<6>, z.ZodLiteral<7>]>, z.ZodTransform<"Monday" | "Tuesday" | "Wednesday" | "Thursday" | "Friday" | "Saturday" | "Sunday", 2 | 1 | 3 | 4 | 5 | 6 | 7>>;
39
+ export declare const DayOfWeekSchema: z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>, z.ZodLiteral<6>, z.ZodLiteral<7>]>, z.ZodTransform<"Monday" | "Tuesday" | "Wednesday" | "Thursday" | "Friday" | "Saturday" | "Sunday", 2 | 1 | 3 | 4 | 5 | 7 | 6>>;
@@ -717,6 +717,7 @@ export declare const validateReminder: (input: unknown) => {
717
717
  lang?: string | null | undefined;
718
718
  };
719
719
  projectId?: string | undefined;
720
+ isUrgent?: boolean | undefined;
720
721
  } | {
721
722
  [x: string]: unknown;
722
723
  id: string;
@@ -734,6 +735,7 @@ export declare const validateReminder: (input: unknown) => {
734
735
  timezone?: string | null | undefined;
735
736
  lang?: string | null | undefined;
736
737
  } | undefined;
738
+ isUrgent?: boolean | undefined;
737
739
  };
738
740
  export declare const validateReminderArray: (input: unknown[]) => ({
739
741
  [x: string]: unknown;
@@ -764,6 +766,7 @@ export declare const validateReminderArray: (input: unknown[]) => ({
764
766
  lang?: string | null | undefined;
765
767
  };
766
768
  projectId?: string | undefined;
769
+ isUrgent?: boolean | undefined;
767
770
  } | {
768
771
  [x: string]: unknown;
769
772
  id: string;
@@ -781,6 +784,7 @@ export declare const validateReminderArray: (input: unknown[]) => ({
781
784
  timezone?: string | null | undefined;
782
785
  lang?: string | null | undefined;
783
786
  } | undefined;
787
+ isUrgent?: boolean | undefined;
784
788
  })[];
785
789
  export declare const validateCompletedInfo: (input: unknown) => {
786
790
  [x: string]: unknown;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doist/todoist-api-typescript",
3
- "version": "7.3.0",
3
+ "version": "7.5.0",
4
4
  "description": "A typescript wrapper for the Todoist REST API.",
5
5
  "author": "Doist developers",
6
6
  "repository": "https://github.com/Doist/todoist-api-typescript",
@@ -19,14 +19,14 @@
19
19
  },
20
20
  "sideEffects": false,
21
21
  "engines": {
22
- "node": ">=20.0.0"
22
+ "node": ">=20.18.1"
23
23
  },
24
24
  "scripts": {
25
25
  "clean": "rimraf dist",
26
26
  "format-check": "npx prettier --check \"./**/*.{ts,tsx,json,md,yml,babelrc,html}\" --ignore-path .prettierignore",
27
27
  "format-fix": "npx prettier --write \"./**/*.{ts,tsx,json,md,yml,babelrc,html}\" --ignore-path .prettierignore",
28
- "lint": "eslint ./src --ext ts,tsx --fix",
29
- "lint-check": "eslint ./src --ext ts,tsx",
28
+ "lint": "oxlint src --fix",
29
+ "lint-check": "oxlint src",
30
30
  "ts-compile-check": "npx tsc -p tsconfig.typecheck.json",
31
31
  "audit": "npm audit --audit-level=moderate",
32
32
  "test": "vitest run",
@@ -54,27 +54,20 @@
54
54
  "zod": "4.3.6"
55
55
  },
56
56
  "devDependencies": {
57
- "@doist/eslint-config": "12.0.0",
58
57
  "@doist/prettier-config": "4.0.0",
59
- "@typescript-eslint/eslint-plugin": "8.46.3",
60
- "@typescript-eslint/parser": "8.46.3",
61
58
  "dotenv": "17.3.1",
62
- "eslint": "8.57.1",
63
- "eslint-config-prettier": "8.7.0",
64
- "eslint-import-resolver-webpack": "0.13.2",
65
- "eslint-plugin-import": "2.27.5",
66
- "eslint-plugin-prettier": "5.1.3",
67
59
  "husky": "9.1.7",
68
60
  "lint-staged": "16.2.7",
69
- "msw": "2.12.10",
61
+ "msw": "2.12.13",
70
62
  "npm-run-all2": "8.0.4",
71
63
  "obsidian": "^1.10.2-1",
64
+ "oxlint": "1.57.0",
72
65
  "prettier": "3.3.2",
73
- "rimraf": "6.1.2",
74
- "vitest": "4.0.14",
66
+ "rimraf": "6.1.3",
75
67
  "ts-node": "10.9.2",
76
68
  "type-fest": "^5.0.0",
77
- "typescript": "5.9.3"
69
+ "typescript": "5.9.3",
70
+ "vitest": "4.0.14"
78
71
  },
79
72
  "peerDependencies": {
80
73
  "type-fest": "^4.12.0"
@@ -86,7 +79,7 @@
86
79
  }
87
80
  },
88
81
  "lint-staged": {
89
- "*.{ts,tsx}": "eslint --fix",
82
+ "*.{ts,tsx}": "oxlint --fix",
90
83
  "*.{ts,tsx,json,html,yml,yaml,md}": "prettier --check"
91
84
  },
92
85
  "files": [
@@ -1,3 +0,0 @@
1
- "use strict";
2
- // This file is reserved for future test utilities
3
- // All network mocking is now handled by MSW in msw-setup.ts
@@ -1,3 +0,0 @@
1
- "use strict";
2
- // This file is reserved for future test utilities
3
- // All network mocking is now handled by MSW in msw-setup.ts
File without changes