@doist/todoist-api-typescript 7.1.1 → 7.3.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 (32) hide show
  1. package/dist/cjs/test-utils/msw-setup.js +4 -3
  2. package/dist/cjs/todoist-api.js +105 -0
  3. package/dist/cjs/types/entities.js +43 -26
  4. package/dist/cjs/types/sync/resources/calendars.js +7 -3
  5. package/dist/cjs/types/sync/resources/collaborators.js +4 -2
  6. package/dist/cjs/types/sync/resources/reminders.js +8 -6
  7. package/dist/cjs/types/sync/resources/suggestions.js +11 -7
  8. package/dist/cjs/types/sync/resources/user-settings.js +5 -5
  9. package/dist/cjs/types/sync/resources/user.js +11 -15
  10. package/dist/cjs/types/sync/resources/view-options.js +33 -25
  11. package/dist/esm/test-utils/msw-setup.js +1 -0
  12. package/dist/esm/todoist-api.js +105 -0
  13. package/dist/esm/types/entities.js +32 -15
  14. package/dist/esm/types/sync/resources/calendars.js +6 -2
  15. package/dist/esm/types/sync/resources/collaborators.js +3 -1
  16. package/dist/esm/types/sync/resources/reminders.js +4 -2
  17. package/dist/esm/types/sync/resources/suggestions.js +8 -4
  18. package/dist/esm/types/sync/resources/user-settings.js +2 -2
  19. package/dist/esm/types/sync/resources/user.js +6 -10
  20. package/dist/esm/types/sync/resources/view-options.js +22 -14
  21. package/dist/types/todoist-api.d.ts +31 -20
  22. package/dist/types/types/entities.d.ts +48 -1
  23. package/dist/types/types/sync/commands/project-view-options.d.ts +2 -2
  24. package/dist/types/types/sync/commands/view-options.d.ts +3 -7
  25. package/dist/types/types/sync/resources/calendars.d.ts +8 -0
  26. package/dist/types/types/sync/resources/collaborators.d.ts +4 -0
  27. package/dist/types/types/sync/resources/reminders.d.ts +11 -0
  28. package/dist/types/types/sync/resources/suggestions.d.ts +42 -0
  29. package/dist/types/types/sync/resources/user-settings.d.ts +8 -0
  30. package/dist/types/types/sync/resources/user.d.ts +30 -0
  31. package/dist/types/types/sync/resources/view-options.d.ts +75 -0
  32. package/package.json +5 -5
@@ -8,6 +8,14 @@ export declare const CalendarSchema: z.ZodObject<{
8
8
  isTaskCalendar: z.ZodOptional<z.ZodBoolean>;
9
9
  }, z.core.$loose>;
10
10
  export type Calendar = z.infer<typeof CalendarSchema>;
11
+ /** Available calendar account provider types. */
12
+ export declare const CALENDAR_ACCOUNT_TYPES: readonly ["google", "microsoft", "apple"];
13
+ /** Calendar account provider type. */
14
+ export type CalendarAccountType = (typeof CALENDAR_ACCOUNT_TYPES)[number];
15
+ /** Available calendar sync states. */
16
+ export declare const CALENDAR_SYNC_STATES: readonly ["synced", "syncing", "error"];
17
+ /** Sync state of a calendar account. */
18
+ export type CalendarSyncState = (typeof CALENDAR_SYNC_STATES)[number];
11
19
  export declare const CalendarAccountSchema: z.ZodObject<{
12
20
  id: z.ZodString;
13
21
  name: z.ZodString;
@@ -7,6 +7,10 @@ export declare const CollaboratorSchema: z.ZodObject<{
7
7
  imageId: z.ZodNullable<z.ZodString>;
8
8
  }, z.core.$loose>;
9
9
  export type Collaborator = z.infer<typeof CollaboratorSchema>;
10
+ /** Available collaborator statuses. */
11
+ export declare const COLLABORATOR_STATUSES: readonly ["active", "invited"];
12
+ /** Status of a project collaborator. */
13
+ export type CollaboratorStatus = (typeof COLLABORATOR_STATUSES)[number];
10
14
  export declare const CollaboratorStateSchema: z.ZodObject<{
11
15
  userId: z.ZodString;
12
16
  projectId: z.ZodString;
@@ -1,4 +1,15 @@
1
1
  import { z } from 'zod';
2
+ export declare const ReminderBaseSchema: z.ZodObject<{
3
+ id: z.ZodString;
4
+ notifyUid: z.ZodString;
5
+ itemId: z.ZodString;
6
+ projectId: z.ZodOptional<z.ZodString>;
7
+ isDeleted: z.ZodBoolean;
8
+ }, z.core.$strip>;
9
+ /** Available location reminder triggers. */
10
+ export declare const LOCATION_TRIGGERS: readonly ["on_enter", "on_leave"];
11
+ /** Trigger condition for a location-based reminder. */
12
+ export type LocationTrigger = (typeof LOCATION_TRIGGERS)[number];
2
13
  export declare const LocationReminderSchema: z.ZodObject<{
3
14
  id: z.ZodString;
4
15
  notifyUid: z.ZodString;
@@ -1,4 +1,8 @@
1
1
  import { z } from 'zod';
2
+ /** Available template types. */
3
+ export declare const TEMPLATE_TYPES: readonly ["project", "setup"];
4
+ /** Type of template suggestion. */
5
+ export type TemplateType = (typeof TEMPLATE_TYPES)[number];
2
6
  export declare const TemplateSuggestionSchema: z.ZodObject<{
3
7
  id: z.ZodString;
4
8
  name: z.ZodString;
@@ -18,6 +22,44 @@ export declare const WorkspaceTemplateSuggestionSchema: z.ZodObject<{
18
22
  workspaceId: z.ZodNullable<z.ZodString>;
19
23
  }, z.core.$loose>;
20
24
  export type WorkspaceTemplateSuggestion = z.infer<typeof WorkspaceTemplateSuggestionSchema>;
25
+ /** Available suggestion section types. */
26
+ export declare const SUGGESTION_SECTION_TYPES: readonly ["templates", "most_used_user_templates"];
27
+ /** Type of suggestion section. */
28
+ export type SuggestionSectionType = (typeof SUGGESTION_SECTION_TYPES)[number];
29
+ export declare const SyncTemplateSuggestionsSchema: z.ZodObject<{
30
+ type: z.ZodEnum<{
31
+ templates: "templates";
32
+ most_used_user_templates: "most_used_user_templates";
33
+ }>;
34
+ content: z.ZodObject<{
35
+ templates: z.ZodArray<z.ZodObject<{
36
+ id: z.ZodString;
37
+ name: z.ZodString;
38
+ templateType: z.ZodEnum<{
39
+ project: "project";
40
+ setup: "setup";
41
+ }>;
42
+ }, z.core.$loose>>;
43
+ locale: z.ZodString;
44
+ }, z.core.$strip>;
45
+ isDeleted: z.ZodBoolean;
46
+ }, z.core.$loose>;
47
+ export declare const SyncWorkspaceTemplateSuggestionsSchema: z.ZodObject<{
48
+ type: z.ZodLiteral<"most_used_workspace_templates">;
49
+ content: z.ZodObject<{
50
+ templates: z.ZodArray<z.ZodObject<{
51
+ id: z.ZodString;
52
+ name: z.ZodString;
53
+ templateType: z.ZodEnum<{
54
+ project: "project";
55
+ setup: "setup";
56
+ }>;
57
+ workspaceId: z.ZodNullable<z.ZodString>;
58
+ }, z.core.$loose>>;
59
+ locale: z.ZodString;
60
+ }, z.core.$strip>;
61
+ isDeleted: z.ZodBoolean;
62
+ }, z.core.$loose>;
21
63
  export declare const SuggestionSchema: z.ZodUnion<readonly [z.ZodObject<{
22
64
  type: z.ZodLiteral<"most_used_workspace_templates">;
23
65
  content: z.ZodObject<{
@@ -1,4 +1,12 @@
1
1
  import { z } from 'zod';
2
+ export declare const NavigationFeatureSchema: z.ZodObject<{
3
+ name: z.ZodString;
4
+ shown: z.ZodBoolean;
5
+ }, z.core.$strip>;
6
+ export declare const QuickAddFeatureSchema: z.ZodObject<{
7
+ name: z.ZodString;
8
+ shown: z.ZodBoolean;
9
+ }, z.core.$strip>;
2
10
  /**
3
11
  * Sync API user settings resource.
4
12
  */
@@ -1,4 +1,34 @@
1
1
  import { z } from 'zod';
2
+ export declare const FeaturesSchema: z.ZodObject<{
3
+ karmaDisabled: z.ZodBoolean;
4
+ restriction: z.ZodNumber;
5
+ karmaVacation: z.ZodBoolean;
6
+ dateistLang: z.ZodAny;
7
+ beta: z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>]>, z.ZodTransform<boolean, 0 | 1>>;
8
+ hasPushReminders: z.ZodBoolean;
9
+ dateistInlineDisabled: z.ZodBoolean;
10
+ autoInviteDisabled: z.ZodOptional<z.ZodBoolean>;
11
+ goldTheme: z.ZodOptional<z.ZodBoolean>;
12
+ migratedFromTdb: z.ZodOptional<z.ZodBoolean>;
13
+ }, z.core.$loose>;
14
+ export declare const TzInfoSchema: z.ZodObject<{
15
+ timezone: z.ZodString;
16
+ hours: z.ZodNumber;
17
+ minutes: z.ZodNumber;
18
+ isDst: z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>]>, z.ZodTransform<boolean, 0 | 1>>;
19
+ gmtString: z.ZodString;
20
+ }, z.core.$loose>;
21
+ export declare const JoinableWorkspaceSchema: z.ZodObject<{
22
+ workspaceId: z.ZodString;
23
+ workspaceName: z.ZodString;
24
+ memberCount: z.ZodNumber;
25
+ }, z.core.$loose>;
26
+ export declare const GettingStartedGuideProjectSchema: z.ZodObject<{
27
+ onboardingUseCase: z.ZodString;
28
+ projectId: z.ZodString;
29
+ completed: z.ZodBoolean;
30
+ closed: z.ZodBoolean;
31
+ }, z.core.$loose>;
2
32
  /**
3
33
  * Sync API user resource.
4
34
  *
@@ -1,4 +1,79 @@
1
1
  import { z } from 'zod';
2
+ /** Available view types. */
3
+ export declare const VIEW_TYPES: readonly ["TODAY", "UPCOMING", "PROJECT", "LABEL", "FILTER", "WORKSPACE_FILTER", "SEARCH", "TEMPLATE_PREVIEW", "TASK_DETAIL", "AUTOMATION", "ASSIGNED", "OVERDUE", "WORKSPACE_OVERVIEW"];
4
+ /** Type of view in the Todoist UI. */
5
+ export type ViewType = (typeof VIEW_TYPES)[number];
6
+ export declare const ViewTypeSchema: z.ZodEnum<{
7
+ TODAY: "TODAY";
8
+ UPCOMING: "UPCOMING";
9
+ PROJECT: "PROJECT";
10
+ LABEL: "LABEL";
11
+ FILTER: "FILTER";
12
+ WORKSPACE_FILTER: "WORKSPACE_FILTER";
13
+ SEARCH: "SEARCH";
14
+ TEMPLATE_PREVIEW: "TEMPLATE_PREVIEW";
15
+ TASK_DETAIL: "TASK_DETAIL";
16
+ AUTOMATION: "AUTOMATION";
17
+ ASSIGNED: "ASSIGNED";
18
+ OVERDUE: "OVERDUE";
19
+ WORKSPACE_OVERVIEW: "WORKSPACE_OVERVIEW";
20
+ }>;
21
+ /** Available view modes. */
22
+ export declare const VIEW_MODES: readonly ["LIST", "BOARD", "CALENDAR"];
23
+ /** Display mode for a view. */
24
+ export type ViewMode = (typeof VIEW_MODES)[number];
25
+ export declare const ViewModeSchema: z.ZodEnum<{
26
+ LIST: "LIST";
27
+ BOARD: "BOARD";
28
+ CALENDAR: "CALENDAR";
29
+ }>;
30
+ /** Available grouping options. */
31
+ export declare const GROUPED_BY_OPTIONS: readonly ["ASSIGNEE", "ADDED_DATE", "DUE_DATE", "DEADLINE", "LABEL", "PRIORITY", "PROJECT", "WORKSPACE"];
32
+ /** Field to group tasks by. */
33
+ export type GroupedBy = (typeof GROUPED_BY_OPTIONS)[number];
34
+ export declare const GroupedBySchema: z.ZodNullable<z.ZodEnum<{
35
+ PROJECT: "PROJECT";
36
+ LABEL: "LABEL";
37
+ ASSIGNEE: "ASSIGNEE";
38
+ ADDED_DATE: "ADDED_DATE";
39
+ DUE_DATE: "DUE_DATE";
40
+ DEADLINE: "DEADLINE";
41
+ PRIORITY: "PRIORITY";
42
+ WORKSPACE: "WORKSPACE";
43
+ }>>;
44
+ /** Available sorting options. */
45
+ export declare const SORTED_BY_OPTIONS: readonly ["MANUAL", "ALPHABETICALLY", "ASSIGNEE", "DUE_DATE", "DEADLINE", "ADDED_DATE", "PRIORITY", "PROJECT", "WORKSPACE"];
46
+ /** Field to sort tasks by. */
47
+ export type SortedBy = (typeof SORTED_BY_OPTIONS)[number];
48
+ export declare const SortedBySchema: z.ZodNullable<z.ZodEnum<{
49
+ MANUAL: "MANUAL";
50
+ PROJECT: "PROJECT";
51
+ ASSIGNEE: "ASSIGNEE";
52
+ ADDED_DATE: "ADDED_DATE";
53
+ DUE_DATE: "DUE_DATE";
54
+ DEADLINE: "DEADLINE";
55
+ PRIORITY: "PRIORITY";
56
+ WORKSPACE: "WORKSPACE";
57
+ ALPHABETICALLY: "ALPHABETICALLY";
58
+ }>>;
59
+ /** Available sort directions. */
60
+ export declare const SORT_ORDERS: readonly ["ASC", "DESC"];
61
+ /** Sort direction. */
62
+ export type SortOrder = (typeof SORT_ORDERS)[number];
63
+ export declare const SortOrderSchema: z.ZodNullable<z.ZodEnum<{
64
+ ASC: "ASC";
65
+ DESC: "DESC";
66
+ }>>;
67
+ /** Available calendar layout modes. */
68
+ export declare const CALENDAR_LAYOUTS: readonly ["WEEK", "MONTH"];
69
+ /** Calendar layout mode. */
70
+ export type CalendarLayout = (typeof CALENDAR_LAYOUTS)[number];
71
+ export declare const CalendarSettingsSchema: z.ZodObject<{
72
+ layout: z.ZodOptional<z.ZodEnum<{
73
+ WEEK: "WEEK";
74
+ MONTH: "MONTH";
75
+ }>>;
76
+ }, z.core.$loose>;
2
77
  export declare const ViewOptionsSchema: z.ZodObject<{
3
78
  viewType: z.ZodEnum<{
4
79
  TODAY: "TODAY";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doist/todoist-api-typescript",
3
- "version": "7.1.1",
3
+ "version": "7.3.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",
@@ -29,7 +29,9 @@
29
29
  "lint-check": "eslint ./src --ext ts,tsx",
30
30
  "ts-compile-check": "npx tsc -p tsconfig.typecheck.json",
31
31
  "audit": "npm audit --audit-level=moderate",
32
- "test": "jest",
32
+ "test": "vitest run",
33
+ "test:watch": "vitest",
34
+ "test:coverage": "vitest run --coverage",
33
35
  "api:request": "node ./scripts/todoist-api-request.cjs",
34
36
  "build:cjs": "npx tsc -p tsconfig.cjs.json",
35
37
  "build:esm": "npx tsc -p tsconfig.esm.json",
@@ -54,7 +56,6 @@
54
56
  "devDependencies": {
55
57
  "@doist/eslint-config": "12.0.0",
56
58
  "@doist/prettier-config": "4.0.0",
57
- "@types/jest": "30.0.0",
58
59
  "@typescript-eslint/eslint-plugin": "8.46.3",
59
60
  "@typescript-eslint/parser": "8.46.3",
60
61
  "dotenv": "17.3.1",
@@ -64,14 +65,13 @@
64
65
  "eslint-plugin-import": "2.27.5",
65
66
  "eslint-plugin-prettier": "5.1.3",
66
67
  "husky": "9.1.7",
67
- "jest": "30.1.3",
68
68
  "lint-staged": "16.2.7",
69
69
  "msw": "2.12.10",
70
70
  "npm-run-all2": "8.0.4",
71
71
  "obsidian": "^1.10.2-1",
72
72
  "prettier": "3.3.2",
73
73
  "rimraf": "6.1.2",
74
- "ts-jest": "29.4.6",
74
+ "vitest": "4.0.14",
75
75
  "ts-node": "10.9.2",
76
76
  "type-fest": "^5.0.0",
77
77
  "typescript": "5.9.3"