@doist/todoist-api-typescript 7.2.0 → 7.4.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/dist/cjs/authentication.js +10 -0
- package/dist/cjs/rest-client.js +1 -1
- package/dist/cjs/test-utils/asserts.js +1 -1
- package/dist/cjs/test-utils/msw-setup.js +4 -3
- package/dist/cjs/todoist-api.js +6 -6
- package/dist/cjs/types/entities.js +45 -26
- package/dist/cjs/types/errors.js +0 -1
- package/dist/cjs/types/sync/commands/labels.js +3 -0
- package/dist/cjs/types/sync/commands/shared.js +21 -0
- package/dist/cjs/types/sync/resources/calendars.js +7 -3
- package/dist/cjs/types/sync/resources/collaborators.js +4 -2
- package/dist/cjs/types/sync/resources/reminders.js +8 -6
- package/dist/cjs/types/sync/resources/suggestions.js +11 -7
- package/dist/cjs/types/sync/resources/user-settings.js +5 -5
- package/dist/cjs/types/sync/resources/user.js +11 -15
- package/dist/cjs/types/sync/resources/view-options.js +33 -25
- package/dist/cjs/types/sync/user-preferences.js +27 -7
- package/dist/cjs/utils/sanitization.js +7 -7
- package/dist/esm/authentication.js +9 -0
- package/dist/esm/rest-client.js +1 -1
- package/dist/esm/test-utils/asserts.js +1 -1
- package/dist/esm/test-utils/msw-setup.js +1 -0
- package/dist/esm/todoist-api.js +6 -6
- package/dist/esm/types/entities.js +34 -15
- package/dist/esm/types/errors.js +0 -1
- package/dist/esm/types/sync/commands/labels.js +2 -1
- package/dist/esm/types/sync/commands/shared.js +20 -1
- package/dist/esm/types/sync/resources/calendars.js +6 -2
- package/dist/esm/types/sync/resources/collaborators.js +3 -1
- package/dist/esm/types/sync/resources/reminders.js +4 -2
- package/dist/esm/types/sync/resources/suggestions.js +8 -4
- package/dist/esm/types/sync/resources/user-settings.js +2 -2
- package/dist/esm/types/sync/resources/user.js +6 -10
- package/dist/esm/types/sync/resources/view-options.js +22 -14
- package/dist/esm/types/sync/user-preferences.js +23 -3
- package/dist/esm/utils/sanitization.js +7 -7
- package/dist/types/authentication.d.ts +5 -3
- package/dist/types/types/entities.d.ts +52 -2
- package/dist/types/types/sync/commands/labels.d.ts +5 -1
- package/dist/types/types/sync/commands/project-view-options.d.ts +2 -2
- package/dist/types/types/sync/commands/reminders.d.ts +3 -2
- package/dist/types/types/sync/commands/shared.d.ts +12 -4
- package/dist/types/types/sync/commands/view-options.d.ts +3 -7
- package/dist/types/types/sync/resources/calendars.d.ts +8 -0
- package/dist/types/types/sync/resources/collaborators.d.ts +4 -0
- package/dist/types/types/sync/resources/reminders.d.ts +11 -0
- package/dist/types/types/sync/resources/suggestions.d.ts +42 -0
- package/dist/types/types/sync/resources/user-settings.d.ts +8 -0
- package/dist/types/types/sync/resources/user.d.ts +32 -2
- package/dist/types/types/sync/resources/view-options.d.ts +75 -0
- package/dist/types/types/sync/user-preferences.d.ts +30 -4
- package/package.json +10 -17
- package/dist/cjs/test-utils/mocks.js +0 -3
- package/dist/esm/test-utils/mocks.js +0 -3
- package/dist/types/test-utils/mocks.d.ts +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
|
|
2
|
+
/** Available view types. */
|
|
3
|
+
export const VIEW_TYPES = [
|
|
3
4
|
'TODAY',
|
|
4
5
|
'UPCOMING',
|
|
5
6
|
'PROJECT',
|
|
@@ -13,10 +14,13 @@ const ViewTypeSchema = z.enum([
|
|
|
13
14
|
'ASSIGNED',
|
|
14
15
|
'OVERDUE',
|
|
15
16
|
'WORKSPACE_OVERVIEW',
|
|
16
|
-
]
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
];
|
|
18
|
+
export const ViewTypeSchema = z.enum(VIEW_TYPES);
|
|
19
|
+
/** Available view modes. */
|
|
20
|
+
export const VIEW_MODES = ['LIST', 'BOARD', 'CALENDAR'];
|
|
21
|
+
export const ViewModeSchema = z.enum(VIEW_MODES);
|
|
22
|
+
/** Available grouping options. */
|
|
23
|
+
export const GROUPED_BY_OPTIONS = [
|
|
20
24
|
'ASSIGNEE',
|
|
21
25
|
'ADDED_DATE',
|
|
22
26
|
'DUE_DATE',
|
|
@@ -25,10 +29,10 @@ const GroupedBySchema = z
|
|
|
25
29
|
'PRIORITY',
|
|
26
30
|
'PROJECT',
|
|
27
31
|
'WORKSPACE',
|
|
28
|
-
]
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
+
];
|
|
33
|
+
export const GroupedBySchema = z.enum(GROUPED_BY_OPTIONS).nullable();
|
|
34
|
+
/** Available sorting options. */
|
|
35
|
+
export const SORTED_BY_OPTIONS = [
|
|
32
36
|
'MANUAL',
|
|
33
37
|
'ALPHABETICALLY',
|
|
34
38
|
'ASSIGNEE',
|
|
@@ -38,12 +42,16 @@ const SortedBySchema = z
|
|
|
38
42
|
'PRIORITY',
|
|
39
43
|
'PROJECT',
|
|
40
44
|
'WORKSPACE',
|
|
41
|
-
]
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
const
|
|
45
|
+
];
|
|
46
|
+
export const SortedBySchema = z.enum(SORTED_BY_OPTIONS).nullable();
|
|
47
|
+
/** Available sort directions. */
|
|
48
|
+
export const SORT_ORDERS = ['ASC', 'DESC'];
|
|
49
|
+
export const SortOrderSchema = z.enum(SORT_ORDERS).nullable();
|
|
50
|
+
/** Available calendar layout modes. */
|
|
51
|
+
export const CALENDAR_LAYOUTS = ['WEEK', 'MONTH'];
|
|
52
|
+
export const CalendarSettingsSchema = z
|
|
45
53
|
.object({
|
|
46
|
-
layout: z.enum(
|
|
54
|
+
layout: z.enum(CALENDAR_LAYOUTS).optional(),
|
|
47
55
|
})
|
|
48
56
|
.passthrough();
|
|
49
57
|
export const ViewOptionsSchema = z
|
|
@@ -1,7 +1,27 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
|
|
2
|
+
/** Available date format options. */
|
|
3
|
+
export const DATE_FORMATS = ['DD/MM/YYYY', 'MM/DD/YYYY'];
|
|
4
|
+
/** Available time format options. */
|
|
5
|
+
export const TIME_FORMATS = ['24h', '12h'];
|
|
6
|
+
/** Available days of the week. */
|
|
7
|
+
export const DAYS_OF_WEEK = [
|
|
8
|
+
'Monday',
|
|
9
|
+
'Tuesday',
|
|
10
|
+
'Wednesday',
|
|
11
|
+
'Thursday',
|
|
12
|
+
'Friday',
|
|
13
|
+
'Saturday',
|
|
14
|
+
'Sunday',
|
|
15
|
+
];
|
|
16
|
+
export const DATE_FORMAT_FROM_API = {
|
|
17
|
+
0: 'DD/MM/YYYY',
|
|
18
|
+
1: 'MM/DD/YYYY',
|
|
19
|
+
};
|
|
20
|
+
export const TIME_FORMAT_FROM_API = {
|
|
21
|
+
0: '24h',
|
|
22
|
+
1: '12h',
|
|
23
|
+
};
|
|
24
|
+
export const DAY_OF_WEEK_FROM_API = {
|
|
5
25
|
1: 'Monday',
|
|
6
26
|
2: 'Tuesday',
|
|
7
27
|
3: 'Wednesday',
|
|
@@ -14,7 +14,7 @@ function removeStyleFormatting(input) {
|
|
|
14
14
|
if (!input.includes('!') && !input.includes('*') && !input.includes('_')) {
|
|
15
15
|
return input;
|
|
16
16
|
}
|
|
17
|
-
function removeMarkdown(
|
|
17
|
+
function removeMarkdown(_match, prefix, text) {
|
|
18
18
|
return `${prefix}${text}`;
|
|
19
19
|
}
|
|
20
20
|
input = input.replace(BOLD_ITALIC_FORMAT, removeMarkdown);
|
|
@@ -23,7 +23,7 @@ function removeStyleFormatting(input) {
|
|
|
23
23
|
return input;
|
|
24
24
|
}
|
|
25
25
|
function removeCodeFormatting(input) {
|
|
26
|
-
function removeMarkdown(
|
|
26
|
+
function removeMarkdown(_match, text) {
|
|
27
27
|
return text;
|
|
28
28
|
}
|
|
29
29
|
input = input.replace(CODE_BLOCK_FORMAT, removeMarkdown);
|
|
@@ -43,7 +43,7 @@ function removeMarkdownLinks(input) {
|
|
|
43
43
|
if (!input.includes('[') || !input.includes(']')) {
|
|
44
44
|
return input;
|
|
45
45
|
}
|
|
46
|
-
function removeMarkdown(
|
|
46
|
+
function removeMarkdown(_match, text) {
|
|
47
47
|
return text;
|
|
48
48
|
}
|
|
49
49
|
return input.replace(MARKDOWN_LINK, removeMarkdown);
|
|
@@ -52,20 +52,20 @@ function removeTodoistLinks(input) {
|
|
|
52
52
|
if (!input.includes('(') || !input.includes(')')) {
|
|
53
53
|
return input;
|
|
54
54
|
}
|
|
55
|
-
function removeMarkdown(
|
|
55
|
+
function removeMarkdown(_match, _url, text) {
|
|
56
56
|
return text;
|
|
57
57
|
}
|
|
58
58
|
return input.replace(TODOIST_LINK, removeMarkdown);
|
|
59
59
|
}
|
|
60
60
|
function removeAppLinks(input) {
|
|
61
61
|
if (input.includes('gmail')) {
|
|
62
|
-
input = input.replace(GMAIL_LINK, (
|
|
62
|
+
input = input.replace(GMAIL_LINK, (_match, _id, text) => text);
|
|
63
63
|
}
|
|
64
64
|
if (input.includes('outlook')) {
|
|
65
|
-
input = input.replace(OUTLOOK_LINK, (
|
|
65
|
+
input = input.replace(OUTLOOK_LINK, (_match, _id, text) => text);
|
|
66
66
|
}
|
|
67
67
|
if (input.includes('thunderbird')) {
|
|
68
|
-
input = input.replace(THUNDERBIRD_LINK, (
|
|
68
|
+
input = input.replace(THUNDERBIRD_LINK, (_match, text) => text);
|
|
69
69
|
}
|
|
70
70
|
return input;
|
|
71
71
|
}
|
|
@@ -6,11 +6,13 @@ export type AuthOptions = {
|
|
|
6
6
|
baseUrl?: string;
|
|
7
7
|
customFetch?: CustomFetch;
|
|
8
8
|
};
|
|
9
|
+
/** Available OAuth2 permission scopes. */
|
|
10
|
+
export declare const PERMISSIONS: readonly ["task:add", "data:read", "data:read_write", "data:delete", "project:delete", "backups:read"];
|
|
9
11
|
/**
|
|
10
|
-
* Permission
|
|
12
|
+
* Permission scope that can be requested during OAuth2 authorization.
|
|
11
13
|
* @see {@link https://todoist.com/api/v1/docs#tag/Authorization}
|
|
12
14
|
*/
|
|
13
|
-
export type Permission =
|
|
15
|
+
export type Permission = (typeof PERMISSIONS)[number];
|
|
14
16
|
/**
|
|
15
17
|
* Parameters required to exchange an authorization code for an access token.
|
|
16
18
|
* @see https://todoist.com/api/v1/docs#tag/Authorization/OAuth
|
|
@@ -69,7 +71,7 @@ export declare function getAuthStateParameter(): string;
|
|
|
69
71
|
*/
|
|
70
72
|
export declare function getAuthorizationUrl({ clientId, permissions, state, baseUrl, }: {
|
|
71
73
|
clientId: string;
|
|
72
|
-
permissions: Permission[];
|
|
74
|
+
permissions: readonly Permission[];
|
|
73
75
|
state: string;
|
|
74
76
|
baseUrl?: string;
|
|
75
77
|
}): string;
|
|
@@ -12,6 +12,10 @@ export declare const DueDateSchema: z.ZodObject<{
|
|
|
12
12
|
* @see https://todoist.com/api/v1/docs#tag/Tasks/operation/get_tasks_api_v1_tasks_get
|
|
13
13
|
*/
|
|
14
14
|
export type DueDate = z.infer<typeof DueDateSchema>;
|
|
15
|
+
/** Available duration units for task deadlines. */
|
|
16
|
+
export declare const DURATION_UNITS: readonly ["minute", "day"];
|
|
17
|
+
/** Unit of time for a task duration. */
|
|
18
|
+
export type DurationUnit = (typeof DURATION_UNITS)[number];
|
|
15
19
|
export declare const DurationSchema: z.ZodObject<{
|
|
16
20
|
amount: z.ZodNumber;
|
|
17
21
|
unit: z.ZodEnum<{
|
|
@@ -240,12 +244,15 @@ export declare const PersonalProjectSchema: z.ZodPipe<z.ZodObject<{
|
|
|
240
244
|
parentId: string | null;
|
|
241
245
|
inboxProject: boolean;
|
|
242
246
|
}>>;
|
|
247
|
+
/** Available project visibility levels. */
|
|
248
|
+
export declare const PROJECT_VISIBILITIES: readonly ["restricted", "team", "public"];
|
|
249
|
+
/** Visibility level of a workspace project. */
|
|
250
|
+
export type ProjectVisibility = (typeof PROJECT_VISIBILITIES)[number];
|
|
243
251
|
export declare const ProjectVisibilitySchema: z.ZodEnum<{
|
|
244
252
|
restricted: "restricted";
|
|
245
253
|
team: "team";
|
|
246
254
|
public: "public";
|
|
247
255
|
}>;
|
|
248
|
-
export type ProjectVisibility = z.infer<typeof ProjectVisibilitySchema>;
|
|
249
256
|
/**
|
|
250
257
|
* Schema for workspace projects in Todoist.
|
|
251
258
|
*/
|
|
@@ -346,10 +353,13 @@ export type PersonalProject = z.infer<typeof PersonalProjectSchema>;
|
|
|
346
353
|
* @see https://todoist.com/api/v1/docs#tag/Projects
|
|
347
354
|
*/
|
|
348
355
|
export type WorkspaceProject = z.infer<typeof WorkspaceProjectSchema>;
|
|
356
|
+
/** Available project view styles. */
|
|
357
|
+
export declare const PROJECT_VIEW_STYLES: readonly ["list", "board", "calendar"];
|
|
349
358
|
/**
|
|
359
|
+
* View style for a project.
|
|
350
360
|
* @see https://todoist.com/api/v1/docs#tag/Projects
|
|
351
361
|
*/
|
|
352
|
-
export type ProjectViewStyle =
|
|
362
|
+
export type ProjectViewStyle = (typeof PROJECT_VIEW_STYLES)[number];
|
|
353
363
|
export declare const SectionSchema: z.ZodPipe<z.ZodObject<{
|
|
354
364
|
id: z.ZodString;
|
|
355
365
|
userId: z.ZodString;
|
|
@@ -405,6 +415,10 @@ export declare const LabelSchema: z.ZodObject<{
|
|
|
405
415
|
* @see https://todoist.com/api/v1/docs#tag/Labels
|
|
406
416
|
*/
|
|
407
417
|
export type Label = z.infer<typeof LabelSchema>;
|
|
418
|
+
/** Available file attachment upload states. */
|
|
419
|
+
export declare const UPLOAD_STATES: readonly ["pending", "completed"];
|
|
420
|
+
/** Upload state of a file attachment. */
|
|
421
|
+
export type UploadState = (typeof UPLOAD_STATES)[number];
|
|
408
422
|
export declare const AttachmentSchema: z.ZodObject<{
|
|
409
423
|
resourceType: z.ZodString;
|
|
410
424
|
fileName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -558,6 +572,10 @@ export declare const TimezoneInfoSchema: z.ZodObject<{
|
|
|
558
572
|
minutes: z.ZodNumber;
|
|
559
573
|
timezone: z.ZodString;
|
|
560
574
|
}, z.core.$strip>;
|
|
575
|
+
/** Available user premium statuses. */
|
|
576
|
+
export declare const PREMIUM_STATUSES: readonly ["not_premium", "current_personal_plan", "legacy_personal_plan", "teams_business_member"];
|
|
577
|
+
/** Premium subscription status of a user. */
|
|
578
|
+
export type PremiumStatus = (typeof PREMIUM_STATUSES)[number];
|
|
561
579
|
export declare const CurrentUserSchema: z.ZodObject<{
|
|
562
580
|
id: z.ZodString;
|
|
563
581
|
email: z.ZodString;
|
|
@@ -602,6 +620,30 @@ export declare const CurrentUserSchema: z.ZodObject<{
|
|
|
602
620
|
* @see https://todoist.com/api/v1/docs#tag/User
|
|
603
621
|
*/
|
|
604
622
|
export type CurrentUser = z.infer<typeof CurrentUserSchema>;
|
|
623
|
+
export declare const StreakSchema: z.ZodObject<{
|
|
624
|
+
count: z.ZodNumber;
|
|
625
|
+
start: z.ZodString;
|
|
626
|
+
end: z.ZodString;
|
|
627
|
+
}, z.core.$strip>;
|
|
628
|
+
export declare const CompletedItemSchema: z.ZodObject<{
|
|
629
|
+
id: z.ZodString;
|
|
630
|
+
completed: z.ZodNumber;
|
|
631
|
+
}, z.core.$strip>;
|
|
632
|
+
export declare const ItemsWithDateSchema: z.ZodObject<{
|
|
633
|
+
items: z.ZodArray<z.ZodObject<{
|
|
634
|
+
id: z.ZodString;
|
|
635
|
+
completed: z.ZodNumber;
|
|
636
|
+
}, z.core.$strip>>;
|
|
637
|
+
totalCompleted: z.ZodNumber;
|
|
638
|
+
}, z.core.$strip>;
|
|
639
|
+
export declare const KarmaUpdateSchema: z.ZodObject<{
|
|
640
|
+
time: z.ZodString;
|
|
641
|
+
newKarma: z.ZodNumber;
|
|
642
|
+
positiveKarma: z.ZodNumber;
|
|
643
|
+
negativeKarma: z.ZodNumber;
|
|
644
|
+
positiveKarmaReasons: z.ZodArray<z.ZodAny>;
|
|
645
|
+
negativeKarmaReasons: z.ZodArray<z.ZodAny>;
|
|
646
|
+
}, z.core.$strip>;
|
|
605
647
|
export declare const ProductivityStatsSchema: z.ZodObject<{
|
|
606
648
|
completedCount: z.ZodNumber;
|
|
607
649
|
daysItems: z.ZodArray<z.ZodObject<{
|
|
@@ -805,6 +847,14 @@ export declare const FormattedPriceListingSchema: z.ZodObject<{
|
|
|
805
847
|
* Formatted price listing for workspace plans.
|
|
806
848
|
*/
|
|
807
849
|
export type FormattedPriceListing = z.infer<typeof FormattedPriceListingSchema>;
|
|
850
|
+
/** Available workspace plan names. */
|
|
851
|
+
export declare const WORKSPACE_CURRENT_PLANS: readonly ["Business", "Starter"];
|
|
852
|
+
/** Display name of a workspace plan. */
|
|
853
|
+
export type WorkspaceCurrentPlan = (typeof WORKSPACE_CURRENT_PLANS)[number];
|
|
854
|
+
/** Available workspace plan statuses. */
|
|
855
|
+
export declare const WORKSPACE_PLAN_STATUSES: readonly ["Active", "Downgraded", "Cancelled", "NeverSubscribed"];
|
|
856
|
+
/** Subscription status of a workspace plan. */
|
|
857
|
+
export type WorkspacePlanStatus = (typeof WORKSPACE_PLAN_STATUSES)[number];
|
|
808
858
|
export declare const WorkspacePlanDetailsSchema: z.ZodObject<{
|
|
809
859
|
currentMemberCount: z.ZodNumber;
|
|
810
860
|
currentPlan: z.ZodEnum<{
|
|
@@ -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?:
|
|
28
|
+
cascade?: LabelDeleteCascadeMode;
|
|
25
29
|
};
|
|
26
30
|
export type LabelDeleteOccurrencesArgs = {
|
|
27
31
|
name: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ViewMode, GroupedBy, SortedBy, SortOrder } from '
|
|
1
|
+
import type { ViewMode, GroupedBy, SortedBy, SortOrder, CalendarLayout } from '../resources/view-options.js';
|
|
2
2
|
export type CalendarSettings = {
|
|
3
|
-
layout?:
|
|
3
|
+
layout?: CalendarLayout;
|
|
4
4
|
};
|
|
5
5
|
export type ProjectViewOptionsDefaultsSetArgs = {
|
|
6
6
|
projectId: string;
|
|
@@ -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?:
|
|
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?:
|
|
46
|
+
locTrigger?: LocationTrigger;
|
|
46
47
|
notifyUid?: string;
|
|
47
48
|
};
|
|
48
49
|
export type ReminderDeleteArgs = {
|
|
@@ -31,16 +31,24 @@ 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 =
|
|
37
|
+
export type ProjectStatus = (typeof PROJECT_STATUSES)[number];
|
|
38
|
+
/** Available default collaborator roles. */
|
|
39
|
+
export declare const COLLABORATOR_ROLES: readonly ["CREATOR", "ADMIN", "READ_WRITE", "EDIT_ONLY", "COMPLETE_ONLY"];
|
|
36
40
|
/** Default collaborator role for a project. */
|
|
37
|
-
export type CollaboratorRole =
|
|
41
|
+
export type CollaboratorRole = (typeof COLLABORATOR_ROLES)[number];
|
|
42
|
+
/** Available reminder notification services. */
|
|
43
|
+
export declare const REMINDER_SERVICES: readonly ["default", "email", "mobile", "push", "no_default"];
|
|
38
44
|
/** Reminder notification service. */
|
|
39
|
-
export type ReminderService =
|
|
45
|
+
export type ReminderService = (typeof REMINDER_SERVICES)[number];
|
|
40
46
|
/**
|
|
41
47
|
* Default access level for workspaces.
|
|
42
48
|
* Same values as {@link ProjectVisibility} from entities.
|
|
43
49
|
*/
|
|
44
50
|
export { type ProjectVisibility as DefaultAccessLevel } from '../../entities.js';
|
|
51
|
+
/** Available workspace project sort orders. */
|
|
52
|
+
export declare const WORKSPACE_PROJECT_SORT_ORDERS: readonly ["MANUAL", "A_TO_Z", "Z_TO_A"];
|
|
45
53
|
/** Workspace project sort order preference. */
|
|
46
|
-
export type WorkspaceProjectSortOrder =
|
|
54
|
+
export type WorkspaceProjectSortOrder = (typeof WORKSPACE_PROJECT_SORT_ORDERS)[number];
|
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
export type ViewMode = 'LIST' | 'BOARD' | 'CALENDAR';
|
|
3
|
-
export type GroupedBy = null | 'ASSIGNEE' | 'ADDED_DATE' | 'DUE_DATE' | 'DEADLINE' | 'LABEL' | 'PRIORITY' | 'PROJECT' | 'WORKSPACE';
|
|
4
|
-
export type SortedBy = null | 'MANUAL' | 'ALPHABETICALLY' | 'ASSIGNEE' | 'DUE_DATE' | 'DEADLINE' | 'ADDED_DATE' | 'PRIORITY' | 'PROJECT' | 'WORKSPACE';
|
|
5
|
-
export type SortOrder = 'ASC' | 'DESC';
|
|
1
|
+
import type { ViewType, ViewMode, GroupedBy, SortedBy, SortOrder } from '../resources/view-options.js';
|
|
6
2
|
export type ViewOptionsSetArgs = {
|
|
7
3
|
viewType: ViewType;
|
|
8
4
|
objectId?: string;
|
|
9
|
-
groupedBy?: GroupedBy;
|
|
5
|
+
groupedBy?: GroupedBy | null;
|
|
10
6
|
filteredBy?: string | null;
|
|
11
7
|
viewMode?: ViewMode;
|
|
12
8
|
showCompletedTasks?: boolean;
|
|
13
|
-
sortedBy?: SortedBy;
|
|
9
|
+
sortedBy?: SortedBy | null;
|
|
14
10
|
sortOrder?: SortOrder | null;
|
|
15
11
|
};
|
|
16
12
|
export type ViewOptionsDeleteArgs = {
|
|
@@ -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
|
*
|
|
@@ -59,7 +89,7 @@ export declare const SyncUserSchema: z.ZodObject<{
|
|
|
59
89
|
mfaEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
60
90
|
mobileHost: z.ZodNullable<z.ZodString>;
|
|
61
91
|
mobileNumber: z.ZodNullable<z.ZodString>;
|
|
62
|
-
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 |
|
|
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>>;
|
|
63
93
|
onboardingLevel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
64
94
|
onboardingRole: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
65
95
|
onboardingPersona: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -83,7 +113,7 @@ export declare const SyncUserSchema: z.ZodObject<{
|
|
|
83
113
|
}, z.core.$strip>>>;
|
|
84
114
|
shareLimit: z.ZodNumber;
|
|
85
115
|
sortOrder: z.ZodNumber;
|
|
86
|
-
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 |
|
|
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>>;
|
|
87
117
|
startPage: z.ZodString;
|
|
88
118
|
themeId: z.ZodString;
|
|
89
119
|
timeFormat: z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>]>, z.ZodTransform<"24h" | "12h", 0 | 1>>;
|
|
@@ -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";
|