@doist/todoist-sdk 8.5.0-next.1 → 9.1.0-next.1
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/test-utils/test-defaults.js +15 -12
- package/dist/cjs/types/activity/types.js +1 -1
- package/dist/cjs/types/comments/types.js +1 -1
- package/dist/cjs/types/insights/types.js +6 -4
- package/dist/cjs/types/projects/types.js +2 -2
- package/dist/cjs/types/sections/types.js +3 -3
- package/dist/cjs/types/sync/resources/live-notifications.js +1 -1
- package/dist/cjs/types/sync/resources/notes.js +1 -1
- package/dist/cjs/types/sync/resources/user.js +4 -4
- package/dist/cjs/types/sync/resources/workspace-filters.js +2 -2
- package/dist/cjs/types/sync/resources/workspace-goals.js +2 -2
- package/dist/cjs/types/sync/resources/workspaces.js +3 -3
- package/dist/cjs/types/tasks/types.js +3 -3
- package/dist/cjs/types/workspaces/types.js +3 -3
- package/dist/esm/test-utils/test-defaults.js +15 -12
- package/dist/esm/types/activity/types.js +1 -1
- package/dist/esm/types/comments/types.js +1 -1
- package/dist/esm/types/insights/types.js +6 -4
- package/dist/esm/types/projects/types.js +2 -2
- package/dist/esm/types/sections/types.js +3 -3
- package/dist/esm/types/sync/resources/live-notifications.js +1 -1
- package/dist/esm/types/sync/resources/notes.js +1 -1
- package/dist/esm/types/sync/resources/user.js +4 -4
- package/dist/esm/types/sync/resources/workspace-filters.js +2 -2
- package/dist/esm/types/sync/resources/workspace-goals.js +2 -2
- package/dist/esm/types/sync/resources/workspaces.js +3 -3
- package/dist/esm/types/tasks/types.js +3 -3
- package/dist/esm/types/workspaces/types.js +3 -3
- package/dist/types/consts/endpoints.d.ts +2 -2
- package/dist/types/test-utils/test-defaults.d.ts +13 -13
- package/dist/types/todoist-api.d.ts +1 -1
- package/dist/types/types/activity/types.d.ts +1 -1
- package/dist/types/types/comments/types.d.ts +4 -4
- package/dist/types/types/folders/requests.d.ts +2 -2
- package/dist/types/types/insights/types.d.ts +9 -9
- package/dist/types/types/projects/requests.d.ts +1 -1
- package/dist/types/types/projects/types.d.ts +18 -18
- package/dist/types/types/sections/types.d.ts +9 -9
- package/dist/types/types/sync/commands/workspaces.d.ts +1 -1
- package/dist/types/types/sync/resources/live-notifications.d.ts +1 -1
- package/dist/types/types/sync/resources/notes.d.ts +1 -1
- package/dist/types/types/sync/resources/user.d.ts +4 -4
- package/dist/types/types/sync/resources/workspace-filters.d.ts +2 -2
- package/dist/types/types/sync/resources/workspace-goals.d.ts +2 -2
- package/dist/types/types/sync/resources/workspaces.d.ts +8 -8
- package/dist/types/types/sync/response.d.ts +41 -41
- package/dist/types/types/tasks/types.d.ts +9 -9
- package/dist/types/types/workspaces/requests.d.ts +7 -7
- package/dist/types/types/workspaces/types.d.ts +6 -6
- package/dist/types/utils/validators.d.ts +56 -56
- package/package.json +1 -1
|
@@ -18,6 +18,9 @@ const DEFAULT_PARENT_ID = '5678';
|
|
|
18
18
|
const DEFAULT_ASSIGNEE = '1234';
|
|
19
19
|
const DEFAULT_CREATOR = '1234';
|
|
20
20
|
const DEFAULT_DATE = '2020-09-08T12:00:00Z';
|
|
21
|
+
function defaultDate() {
|
|
22
|
+
return new Date(DEFAULT_DATE);
|
|
23
|
+
}
|
|
21
24
|
const DEFAULT_ENTITY_COLOR = 'berry_red';
|
|
22
25
|
const DEFAULT_LABELS = ['personal', 'work', 'hobby'];
|
|
23
26
|
const DEFAULT_USER_ID = '5';
|
|
@@ -67,9 +70,9 @@ exports.DEFAULT_TASK = {
|
|
|
67
70
|
duration: exports.DEFAULT_DURATION,
|
|
68
71
|
checked: false,
|
|
69
72
|
isDeleted: DEFAULT_IS_DELETED,
|
|
70
|
-
addedAt:
|
|
73
|
+
addedAt: defaultDate(),
|
|
71
74
|
completedAt: null,
|
|
72
|
-
updatedAt:
|
|
75
|
+
updatedAt: defaultDate(),
|
|
73
76
|
due: exports.DEFAULT_DUE_DATE,
|
|
74
77
|
priority: exports.DEFAULT_TASK_PRIORITY,
|
|
75
78
|
childOrder: exports.DEFAULT_ORDER,
|
|
@@ -95,9 +98,9 @@ exports.TASK_WITH_OPTIONALS_AS_NULL = {
|
|
|
95
98
|
duration: null,
|
|
96
99
|
checked: false,
|
|
97
100
|
isDeleted: DEFAULT_IS_DELETED,
|
|
98
|
-
addedAt:
|
|
101
|
+
addedAt: defaultDate(),
|
|
99
102
|
completedAt: null,
|
|
100
|
-
updatedAt:
|
|
103
|
+
updatedAt: defaultDate(),
|
|
101
104
|
due: null,
|
|
102
105
|
priority: exports.DEFAULT_TASK_PRIORITY,
|
|
103
106
|
childOrder: exports.DEFAULT_ORDER,
|
|
@@ -122,8 +125,8 @@ exports.DEFAULT_PROJECT = {
|
|
|
122
125
|
isArchived: DEFAULT_IS_ARCHIVED,
|
|
123
126
|
isDeleted: DEFAULT_IS_DELETED,
|
|
124
127
|
isFrozen: DEFAULT_IS_FROZEN,
|
|
125
|
-
createdAt:
|
|
126
|
-
updatedAt:
|
|
128
|
+
createdAt: defaultDate(),
|
|
129
|
+
updatedAt: defaultDate(),
|
|
127
130
|
defaultOrder: exports.DEFAULT_ORDER,
|
|
128
131
|
description: '',
|
|
129
132
|
isCollapsed: DEFAULT_IS_COLLAPSED,
|
|
@@ -143,8 +146,8 @@ exports.DEFAULT_WORKSPACE_PROJECT = {
|
|
|
143
146
|
isArchived: DEFAULT_IS_ARCHIVED,
|
|
144
147
|
isDeleted: DEFAULT_IS_DELETED,
|
|
145
148
|
isFrozen: DEFAULT_IS_FROZEN,
|
|
146
|
-
createdAt:
|
|
147
|
-
updatedAt:
|
|
149
|
+
createdAt: defaultDate(),
|
|
150
|
+
updatedAt: defaultDate(),
|
|
148
151
|
defaultOrder: exports.DEFAULT_ORDER,
|
|
149
152
|
description: '',
|
|
150
153
|
isCollapsed: DEFAULT_IS_COLLAPSED,
|
|
@@ -161,8 +164,8 @@ exports.DEFAULT_SECTION = {
|
|
|
161
164
|
id: DEFAULT_SECTION_ID,
|
|
162
165
|
userId: DEFAULT_USER_ID,
|
|
163
166
|
projectId: exports.DEFAULT_PROJECT_ID,
|
|
164
|
-
addedAt: '2025-03-28T14:01:23.334881Z',
|
|
165
|
-
updatedAt: '2025-03-28T14:01:23.334885Z',
|
|
167
|
+
addedAt: new Date('2025-03-28T14:01:23.334881Z'),
|
|
168
|
+
updatedAt: new Date('2025-03-28T14:01:23.334885Z'),
|
|
166
169
|
archivedAt: null,
|
|
167
170
|
name: DEFAULT_SECTION_NAME,
|
|
168
171
|
sectionOrder: exports.DEFAULT_ORDER,
|
|
@@ -200,7 +203,7 @@ exports.DEFAULT_RAW_COMMENT = {
|
|
|
200
203
|
fileAttachment: exports.DEFAULT_ATTACHMENT,
|
|
201
204
|
uidsToNotify: null,
|
|
202
205
|
isDeleted: false,
|
|
203
|
-
postedAt:
|
|
206
|
+
postedAt: defaultDate(),
|
|
204
207
|
reactions: DEFAULT_COMMENT_REACTIONS,
|
|
205
208
|
itemId: exports.DEFAULT_TASK_ID,
|
|
206
209
|
};
|
|
@@ -281,7 +284,7 @@ exports.DEFAULT_NOTE = {
|
|
|
281
284
|
id: DEFAULT_COMMENT_ID,
|
|
282
285
|
projectId: exports.DEFAULT_PROJECT_ID,
|
|
283
286
|
content: DEFAULT_COMMENT_CONTENT,
|
|
284
|
-
postedAt:
|
|
287
|
+
postedAt: defaultDate(),
|
|
285
288
|
fileAttachment: exports.DEFAULT_ATTACHMENT,
|
|
286
289
|
postedUid: DEFAULT_USER_ID,
|
|
287
290
|
uidsToNotify: null,
|
|
@@ -15,7 +15,7 @@ exports.ActivityEventSchema = zod_1.z
|
|
|
15
15
|
objectType: zod_1.z.string(),
|
|
16
16
|
objectId: zod_1.z.string(),
|
|
17
17
|
eventType: zod_1.z.string(),
|
|
18
|
-
eventDate: zod_1.z.
|
|
18
|
+
eventDate: zod_1.z.coerce.date(),
|
|
19
19
|
id: zod_1.z
|
|
20
20
|
.union([zod_1.z.string(), zod_1.z.number()])
|
|
21
21
|
.transform((val) => { var _a; return (_a = val === null || val === void 0 ? void 0 : val.toString()) !== null && _a !== void 0 ? _a : null; })
|
|
@@ -38,7 +38,7 @@ exports.RawCommentSchema = zod_1.z
|
|
|
38
38
|
itemId: zod_1.z.string().optional(),
|
|
39
39
|
projectId: zod_1.z.string().optional(),
|
|
40
40
|
content: zod_1.z.string(),
|
|
41
|
-
postedAt: zod_1.z.
|
|
41
|
+
postedAt: zod_1.z.coerce.date(),
|
|
42
42
|
fileAttachment: exports.AttachmentSchema.nullable(),
|
|
43
43
|
postedUid: zod_1.z.string(),
|
|
44
44
|
uidsToNotify: zod_1.z.array(zod_1.z.string()).nullable(),
|
|
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.WorkspaceInsightsSchema = exports.ProjectInsightSchema = exports.ProjectProgressSchema = exports.ProjectHealthContextSchema = exports.TaskContextSchema = exports.ProjectMetricsSchema = exports.ProjectHealthSchema = exports.TaskRecommendationSchema = exports.HEALTH_STATUSES = exports.ProjectActivityStatsSchema = exports.WeekRollupSchema = exports.DayActivitySchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
exports.DayActivitySchema = zod_1.z.object({
|
|
6
|
+
// Kept as string: this is a calendar-day bucket (e.g. '2025-01-13'), not a timestamp.
|
|
7
|
+
// Coercing to Date would create UTC midnight, causing day-shift for non-UTC consumers.
|
|
6
8
|
date: zod_1.z.string(),
|
|
7
9
|
totalCount: zod_1.z.number().int(),
|
|
8
10
|
});
|
|
@@ -34,7 +36,7 @@ exports.ProjectHealthSchema = zod_1.z.object({
|
|
|
34
36
|
descriptionSummary: zod_1.z.string().nullable().optional(),
|
|
35
37
|
taskRecommendations: zod_1.z.array(exports.TaskRecommendationSchema).nullable().optional(),
|
|
36
38
|
projectId: zod_1.z.string().nullable().optional(),
|
|
37
|
-
updatedAt: zod_1.z.
|
|
39
|
+
updatedAt: zod_1.z.coerce.date().nullable().optional(),
|
|
38
40
|
isStale: zod_1.z.boolean().default(false),
|
|
39
41
|
updateInProgress: zod_1.z.boolean().default(false),
|
|
40
42
|
});
|
|
@@ -53,9 +55,9 @@ exports.TaskContextSchema = zod_1.z.object({
|
|
|
53
55
|
deadline: zod_1.z.string().nullable().optional(),
|
|
54
56
|
priority: zod_1.z.string(),
|
|
55
57
|
isCompleted: zod_1.z.boolean(),
|
|
56
|
-
createdAt: zod_1.z.
|
|
57
|
-
updatedAt: zod_1.z.
|
|
58
|
-
completedAt: zod_1.z.
|
|
58
|
+
createdAt: zod_1.z.coerce.date(),
|
|
59
|
+
updatedAt: zod_1.z.coerce.date(),
|
|
60
|
+
completedAt: zod_1.z.coerce.date().nullable(),
|
|
59
61
|
completedByUid: zod_1.z.string().nullable(),
|
|
60
62
|
labels: zod_1.z.array(zod_1.z.string()),
|
|
61
63
|
});
|
|
@@ -12,13 +12,13 @@ exports.BaseProjectSchema = zod_1.z.object({
|
|
|
12
12
|
canAssignTasks: zod_1.z.boolean(),
|
|
13
13
|
childOrder: zod_1.z.number().int(),
|
|
14
14
|
color: zod_1.z.string(),
|
|
15
|
-
createdAt: zod_1.z.
|
|
15
|
+
createdAt: zod_1.z.coerce.date().nullable(),
|
|
16
16
|
isArchived: zod_1.z.boolean(),
|
|
17
17
|
isDeleted: zod_1.z.boolean(),
|
|
18
18
|
isFavorite: zod_1.z.boolean(),
|
|
19
19
|
isFrozen: zod_1.z.boolean(),
|
|
20
20
|
name: zod_1.z.string(),
|
|
21
|
-
updatedAt: zod_1.z.
|
|
21
|
+
updatedAt: zod_1.z.coerce.date().nullable(),
|
|
22
22
|
viewStyle: zod_1.z.string(),
|
|
23
23
|
defaultOrder: zod_1.z.number().int(),
|
|
24
24
|
description: zod_1.z.string(),
|
|
@@ -8,9 +8,9 @@ exports.SectionSchema = zod_1.z
|
|
|
8
8
|
id: zod_1.z.string(),
|
|
9
9
|
userId: zod_1.z.string(),
|
|
10
10
|
projectId: zod_1.z.string(),
|
|
11
|
-
addedAt: zod_1.z.
|
|
12
|
-
updatedAt: zod_1.z.
|
|
13
|
-
archivedAt: zod_1.z.
|
|
11
|
+
addedAt: zod_1.z.coerce.date(),
|
|
12
|
+
updatedAt: zod_1.z.coerce.date(),
|
|
13
|
+
archivedAt: zod_1.z.coerce.date().nullable(),
|
|
14
14
|
name: zod_1.z.string(),
|
|
15
15
|
sectionOrder: zod_1.z.number().int(),
|
|
16
16
|
isArchived: zod_1.z.boolean(),
|
|
@@ -12,7 +12,7 @@ const zod_1 = require("zod");
|
|
|
12
12
|
*/
|
|
13
13
|
exports.LiveNotificationSchema = zod_1.z.looseObject({
|
|
14
14
|
id: zod_1.z.string(),
|
|
15
|
-
createdAt: zod_1.z.
|
|
15
|
+
createdAt: zod_1.z.coerce.date(),
|
|
16
16
|
fromUid: zod_1.z.string(),
|
|
17
17
|
notificationType: zod_1.z.string(),
|
|
18
18
|
isUnread: zod_1.z.boolean(),
|
|
@@ -12,7 +12,7 @@ exports.NoteSchema = zod_1.z.looseObject({
|
|
|
12
12
|
itemId: zod_1.z.string().optional(),
|
|
13
13
|
projectId: zod_1.z.string().optional(),
|
|
14
14
|
content: zod_1.z.string(),
|
|
15
|
-
postedAt: zod_1.z.
|
|
15
|
+
postedAt: zod_1.z.coerce.date(),
|
|
16
16
|
fileAttachment: types_1.AttachmentSchema.nullable(),
|
|
17
17
|
postedUid: zod_1.z.string(),
|
|
18
18
|
uidsToNotify: zod_1.z.array(zod_1.z.string()).nullable(),
|
|
@@ -57,7 +57,7 @@ exports.SyncUserSchema = zod_1.z.looseObject({
|
|
|
57
57
|
daysOff: zod_1.z.array(zod_1.z.number().int()),
|
|
58
58
|
featureIdentifier: zod_1.z.string(),
|
|
59
59
|
features: exports.FeaturesSchema,
|
|
60
|
-
freeTrailExpires: zod_1.z.
|
|
60
|
+
freeTrailExpires: zod_1.z.coerce.date().optional(),
|
|
61
61
|
hasMagicNumber: zod_1.z.boolean(),
|
|
62
62
|
hasPassword: zod_1.z.boolean(),
|
|
63
63
|
hasStartedATrial: zod_1.z.boolean().optional(),
|
|
@@ -66,7 +66,7 @@ exports.SyncUserSchema = zod_1.z.looseObject({
|
|
|
66
66
|
isCelebrationsEnabled: zod_1.z.boolean(),
|
|
67
67
|
isPremium: zod_1.z.boolean(),
|
|
68
68
|
joinableWorkspace: exports.JoinableWorkspaceSchema.nullable(),
|
|
69
|
-
joinedAt: zod_1.z.
|
|
69
|
+
joinedAt: zod_1.z.coerce.date(),
|
|
70
70
|
gettingStartedGuideProjects: zod_1.z.array(exports.GettingStartedGuideProjectSchema).nullable(),
|
|
71
71
|
karma: zod_1.z.number(),
|
|
72
72
|
karmaTrend: zod_1.z.string(),
|
|
@@ -84,13 +84,13 @@ exports.SyncUserSchema = zod_1.z.looseObject({
|
|
|
84
84
|
onboardingTeamMode: zod_1.z.boolean().nullable().optional(),
|
|
85
85
|
onboardingUseCases: zod_1.z.array(zod_1.z.string()).nullable().optional(),
|
|
86
86
|
premiumStatus: zod_1.z.enum(types_1.PREMIUM_STATUSES),
|
|
87
|
-
premiumUntil: zod_1.z.
|
|
87
|
+
premiumUntil: zod_1.z.coerce.date().nullable(),
|
|
88
88
|
rambleSessionsUsage: zod_1.z
|
|
89
89
|
.object({
|
|
90
90
|
currentCount: zod_1.z.number().int(),
|
|
91
91
|
limit: zod_1.z.number().int(),
|
|
92
92
|
remaining: zod_1.z.number().int(),
|
|
93
|
-
resetDate: zod_1.z.
|
|
93
|
+
resetDate: zod_1.z.coerce.date(),
|
|
94
94
|
})
|
|
95
95
|
.nullable()
|
|
96
96
|
.optional(),
|
|
@@ -14,6 +14,6 @@ exports.WorkspaceFilterSchema = zod_1.z.looseObject({
|
|
|
14
14
|
isFrozen: zod_1.z.boolean(),
|
|
15
15
|
creatorUid: zod_1.z.string(),
|
|
16
16
|
updaterUid: zod_1.z.string(),
|
|
17
|
-
createdAt: zod_1.z.
|
|
18
|
-
updatedAt: zod_1.z.
|
|
17
|
+
createdAt: zod_1.z.coerce.date(),
|
|
18
|
+
updatedAt: zod_1.z.coerce.date(),
|
|
19
19
|
});
|
|
@@ -21,6 +21,6 @@ exports.WorkspaceGoalSchema = zod_1.z.looseObject({
|
|
|
21
21
|
projectIds: zod_1.z.array(zod_1.z.string()),
|
|
22
22
|
progress: exports.WorkspaceGoalProgressSchema.nullable(),
|
|
23
23
|
creatorUid: zod_1.z.string(),
|
|
24
|
-
createdAt: zod_1.z.
|
|
25
|
-
updatedAt: zod_1.z.
|
|
24
|
+
createdAt: zod_1.z.coerce.date(),
|
|
25
|
+
updatedAt: zod_1.z.coerce.date(),
|
|
26
26
|
});
|
|
@@ -32,8 +32,8 @@ exports.SyncWorkspaceSchema = zod_1.z
|
|
|
32
32
|
logoSmall: zod_1.z.string().optional(),
|
|
33
33
|
logoS640: zod_1.z.string().optional(),
|
|
34
34
|
creatorId: common_1.StringOrNumberSchema,
|
|
35
|
-
createdAt: zod_1.z.
|
|
36
|
-
dateCreated: zod_1.z.
|
|
35
|
+
createdAt: zod_1.z.coerce.date().optional(),
|
|
36
|
+
dateCreated: zod_1.z.coerce.date().optional(),
|
|
37
37
|
isDeleted: zod_1.z.boolean(),
|
|
38
38
|
isCollapsed: zod_1.z.boolean(),
|
|
39
39
|
role: types_1.WorkspaceRoleSchema.optional(),
|
|
@@ -61,7 +61,7 @@ exports.SyncWorkspaceSchema = zod_1.z
|
|
|
61
61
|
defaultCollaborators: zod_1.z
|
|
62
62
|
.object({
|
|
63
63
|
predefinedGroupIds: zod_1.z.array(zod_1.z.string()),
|
|
64
|
-
userIds: zod_1.z.array(
|
|
64
|
+
userIds: zod_1.z.array(common_1.StringOrNumberSchema),
|
|
65
65
|
})
|
|
66
66
|
.optional(),
|
|
67
67
|
properties: types_1.WorkspacePropertiesSchema.optional(),
|
|
@@ -40,9 +40,9 @@ exports.TaskSchema = zod_1.z
|
|
|
40
40
|
duration: exports.DurationSchema.nullable(),
|
|
41
41
|
checked: zod_1.z.boolean(),
|
|
42
42
|
isDeleted: zod_1.z.boolean(),
|
|
43
|
-
addedAt: zod_1.z.
|
|
44
|
-
completedAt: zod_1.z.
|
|
45
|
-
updatedAt: zod_1.z.
|
|
43
|
+
addedAt: zod_1.z.coerce.date().nullable(),
|
|
44
|
+
completedAt: zod_1.z.coerce.date().nullable(),
|
|
45
|
+
updatedAt: zod_1.z.coerce.date().nullable(),
|
|
46
46
|
due: exports.DueDateSchema.nullable(),
|
|
47
47
|
priority: zod_1.z.number().int(),
|
|
48
48
|
childOrder: zod_1.z.number().int(),
|
|
@@ -74,7 +74,7 @@ exports.WorkspacePlanDetailsSchema = zod_1.z.object({
|
|
|
74
74
|
currentActiveProjects: zod_1.z.number(),
|
|
75
75
|
maximumActiveProjects: zod_1.z.number(),
|
|
76
76
|
priceList: zod_1.z.array(exports.FormattedPriceListingSchema),
|
|
77
|
-
workspaceId:
|
|
77
|
+
workspaceId: common_1.StringOrNumberSchema,
|
|
78
78
|
isTrialing: zod_1.z.boolean(),
|
|
79
79
|
trialEndsAt: zod_1.z.string().nullable(),
|
|
80
80
|
cancelAtPeriodEnd: zod_1.z.boolean(),
|
|
@@ -125,8 +125,8 @@ exports.WorkspaceSchema = zod_1.z
|
|
|
125
125
|
logoMedium: zod_1.z.string().nullish(),
|
|
126
126
|
logoSmall: zod_1.z.string().nullish(),
|
|
127
127
|
logoS640: zod_1.z.string().nullish(),
|
|
128
|
-
createdAt: zod_1.z.
|
|
129
|
-
dateCreated: zod_1.z.
|
|
128
|
+
createdAt: zod_1.z.coerce.date().optional(),
|
|
129
|
+
dateCreated: zod_1.z.coerce.date().optional(),
|
|
130
130
|
creatorId: common_1.StringOrNumberSchema,
|
|
131
131
|
properties: exports.WorkspacePropertiesSchema,
|
|
132
132
|
})
|
|
@@ -15,6 +15,9 @@ const DEFAULT_PARENT_ID = '5678';
|
|
|
15
15
|
const DEFAULT_ASSIGNEE = '1234';
|
|
16
16
|
const DEFAULT_CREATOR = '1234';
|
|
17
17
|
const DEFAULT_DATE = '2020-09-08T12:00:00Z';
|
|
18
|
+
function defaultDate() {
|
|
19
|
+
return new Date(DEFAULT_DATE);
|
|
20
|
+
}
|
|
18
21
|
const DEFAULT_ENTITY_COLOR = 'berry_red';
|
|
19
22
|
const DEFAULT_LABELS = ['personal', 'work', 'hobby'];
|
|
20
23
|
const DEFAULT_USER_ID = '5';
|
|
@@ -64,9 +67,9 @@ export const DEFAULT_TASK = {
|
|
|
64
67
|
duration: DEFAULT_DURATION,
|
|
65
68
|
checked: false,
|
|
66
69
|
isDeleted: DEFAULT_IS_DELETED,
|
|
67
|
-
addedAt:
|
|
70
|
+
addedAt: defaultDate(),
|
|
68
71
|
completedAt: null,
|
|
69
|
-
updatedAt:
|
|
72
|
+
updatedAt: defaultDate(),
|
|
70
73
|
due: DEFAULT_DUE_DATE,
|
|
71
74
|
priority: DEFAULT_TASK_PRIORITY,
|
|
72
75
|
childOrder: DEFAULT_ORDER,
|
|
@@ -92,9 +95,9 @@ export const TASK_WITH_OPTIONALS_AS_NULL = {
|
|
|
92
95
|
duration: null,
|
|
93
96
|
checked: false,
|
|
94
97
|
isDeleted: DEFAULT_IS_DELETED,
|
|
95
|
-
addedAt:
|
|
98
|
+
addedAt: defaultDate(),
|
|
96
99
|
completedAt: null,
|
|
97
|
-
updatedAt:
|
|
100
|
+
updatedAt: defaultDate(),
|
|
98
101
|
due: null,
|
|
99
102
|
priority: DEFAULT_TASK_PRIORITY,
|
|
100
103
|
childOrder: DEFAULT_ORDER,
|
|
@@ -119,8 +122,8 @@ export const DEFAULT_PROJECT = {
|
|
|
119
122
|
isArchived: DEFAULT_IS_ARCHIVED,
|
|
120
123
|
isDeleted: DEFAULT_IS_DELETED,
|
|
121
124
|
isFrozen: DEFAULT_IS_FROZEN,
|
|
122
|
-
createdAt:
|
|
123
|
-
updatedAt:
|
|
125
|
+
createdAt: defaultDate(),
|
|
126
|
+
updatedAt: defaultDate(),
|
|
124
127
|
defaultOrder: DEFAULT_ORDER,
|
|
125
128
|
description: '',
|
|
126
129
|
isCollapsed: DEFAULT_IS_COLLAPSED,
|
|
@@ -140,8 +143,8 @@ export const DEFAULT_WORKSPACE_PROJECT = {
|
|
|
140
143
|
isArchived: DEFAULT_IS_ARCHIVED,
|
|
141
144
|
isDeleted: DEFAULT_IS_DELETED,
|
|
142
145
|
isFrozen: DEFAULT_IS_FROZEN,
|
|
143
|
-
createdAt:
|
|
144
|
-
updatedAt:
|
|
146
|
+
createdAt: defaultDate(),
|
|
147
|
+
updatedAt: defaultDate(),
|
|
145
148
|
defaultOrder: DEFAULT_ORDER,
|
|
146
149
|
description: '',
|
|
147
150
|
isCollapsed: DEFAULT_IS_COLLAPSED,
|
|
@@ -158,8 +161,8 @@ export const DEFAULT_SECTION = {
|
|
|
158
161
|
id: DEFAULT_SECTION_ID,
|
|
159
162
|
userId: DEFAULT_USER_ID,
|
|
160
163
|
projectId: DEFAULT_PROJECT_ID,
|
|
161
|
-
addedAt: '2025-03-28T14:01:23.334881Z',
|
|
162
|
-
updatedAt: '2025-03-28T14:01:23.334885Z',
|
|
164
|
+
addedAt: new Date('2025-03-28T14:01:23.334881Z'),
|
|
165
|
+
updatedAt: new Date('2025-03-28T14:01:23.334885Z'),
|
|
163
166
|
archivedAt: null,
|
|
164
167
|
name: DEFAULT_SECTION_NAME,
|
|
165
168
|
sectionOrder: DEFAULT_ORDER,
|
|
@@ -197,7 +200,7 @@ export const DEFAULT_RAW_COMMENT = {
|
|
|
197
200
|
fileAttachment: DEFAULT_ATTACHMENT,
|
|
198
201
|
uidsToNotify: null,
|
|
199
202
|
isDeleted: false,
|
|
200
|
-
postedAt:
|
|
203
|
+
postedAt: defaultDate(),
|
|
201
204
|
reactions: DEFAULT_COMMENT_REACTIONS,
|
|
202
205
|
itemId: DEFAULT_TASK_ID,
|
|
203
206
|
};
|
|
@@ -278,7 +281,7 @@ export const DEFAULT_NOTE = {
|
|
|
278
281
|
id: DEFAULT_COMMENT_ID,
|
|
279
282
|
projectId: DEFAULT_PROJECT_ID,
|
|
280
283
|
content: DEFAULT_COMMENT_CONTENT,
|
|
281
|
-
postedAt:
|
|
284
|
+
postedAt: defaultDate(),
|
|
282
285
|
fileAttachment: DEFAULT_ATTACHMENT,
|
|
283
286
|
postedUid: DEFAULT_USER_ID,
|
|
284
287
|
uidsToNotify: null,
|
|
@@ -12,7 +12,7 @@ export const ActivityEventSchema = z
|
|
|
12
12
|
objectType: z.string(),
|
|
13
13
|
objectId: z.string(),
|
|
14
14
|
eventType: z.string(),
|
|
15
|
-
eventDate: z.
|
|
15
|
+
eventDate: z.coerce.date(),
|
|
16
16
|
id: z
|
|
17
17
|
.union([z.string(), z.number()])
|
|
18
18
|
.transform((val) => { var _a; return (_a = val === null || val === void 0 ? void 0 : val.toString()) !== null && _a !== void 0 ? _a : null; })
|
|
@@ -35,7 +35,7 @@ export const RawCommentSchema = z
|
|
|
35
35
|
itemId: z.string().optional(),
|
|
36
36
|
projectId: z.string().optional(),
|
|
37
37
|
content: z.string(),
|
|
38
|
-
postedAt: z.
|
|
38
|
+
postedAt: z.coerce.date(),
|
|
39
39
|
fileAttachment: AttachmentSchema.nullable(),
|
|
40
40
|
postedUid: z.string(),
|
|
41
41
|
uidsToNotify: z.array(z.string()).nullable(),
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export const DayActivitySchema = z.object({
|
|
3
|
+
// Kept as string: this is a calendar-day bucket (e.g. '2025-01-13'), not a timestamp.
|
|
4
|
+
// Coercing to Date would create UTC midnight, causing day-shift for non-UTC consumers.
|
|
3
5
|
date: z.string(),
|
|
4
6
|
totalCount: z.number().int(),
|
|
5
7
|
});
|
|
@@ -31,7 +33,7 @@ export const ProjectHealthSchema = z.object({
|
|
|
31
33
|
descriptionSummary: z.string().nullable().optional(),
|
|
32
34
|
taskRecommendations: z.array(TaskRecommendationSchema).nullable().optional(),
|
|
33
35
|
projectId: z.string().nullable().optional(),
|
|
34
|
-
updatedAt: z.
|
|
36
|
+
updatedAt: z.coerce.date().nullable().optional(),
|
|
35
37
|
isStale: z.boolean().default(false),
|
|
36
38
|
updateInProgress: z.boolean().default(false),
|
|
37
39
|
});
|
|
@@ -50,9 +52,9 @@ export const TaskContextSchema = z.object({
|
|
|
50
52
|
deadline: z.string().nullable().optional(),
|
|
51
53
|
priority: z.string(),
|
|
52
54
|
isCompleted: z.boolean(),
|
|
53
|
-
createdAt: z.
|
|
54
|
-
updatedAt: z.
|
|
55
|
-
completedAt: z.
|
|
55
|
+
createdAt: z.coerce.date(),
|
|
56
|
+
updatedAt: z.coerce.date(),
|
|
57
|
+
completedAt: z.coerce.date().nullable(),
|
|
56
58
|
completedByUid: z.string().nullable(),
|
|
57
59
|
labels: z.array(z.string()),
|
|
58
60
|
});
|
|
@@ -9,13 +9,13 @@ export const BaseProjectSchema = z.object({
|
|
|
9
9
|
canAssignTasks: z.boolean(),
|
|
10
10
|
childOrder: z.number().int(),
|
|
11
11
|
color: z.string(),
|
|
12
|
-
createdAt: z.
|
|
12
|
+
createdAt: z.coerce.date().nullable(),
|
|
13
13
|
isArchived: z.boolean(),
|
|
14
14
|
isDeleted: z.boolean(),
|
|
15
15
|
isFavorite: z.boolean(),
|
|
16
16
|
isFrozen: z.boolean(),
|
|
17
17
|
name: z.string(),
|
|
18
|
-
updatedAt: z.
|
|
18
|
+
updatedAt: z.coerce.date().nullable(),
|
|
19
19
|
viewStyle: z.string(),
|
|
20
20
|
defaultOrder: z.number().int(),
|
|
21
21
|
description: z.string(),
|
|
@@ -5,9 +5,9 @@ export const SectionSchema = z
|
|
|
5
5
|
id: z.string(),
|
|
6
6
|
userId: z.string(),
|
|
7
7
|
projectId: z.string(),
|
|
8
|
-
addedAt: z.
|
|
9
|
-
updatedAt: z.
|
|
10
|
-
archivedAt: z.
|
|
8
|
+
addedAt: z.coerce.date(),
|
|
9
|
+
updatedAt: z.coerce.date(),
|
|
10
|
+
archivedAt: z.coerce.date().nullable(),
|
|
11
11
|
name: z.string(),
|
|
12
12
|
sectionOrder: z.number().int(),
|
|
13
13
|
isArchived: z.boolean(),
|
|
@@ -9,7 +9,7 @@ export const NoteSchema = z.looseObject({
|
|
|
9
9
|
itemId: z.string().optional(),
|
|
10
10
|
projectId: z.string().optional(),
|
|
11
11
|
content: z.string(),
|
|
12
|
-
postedAt: z.
|
|
12
|
+
postedAt: z.coerce.date(),
|
|
13
13
|
fileAttachment: AttachmentSchema.nullable(),
|
|
14
14
|
postedUid: z.string(),
|
|
15
15
|
uidsToNotify: z.array(z.string()).nullable(),
|
|
@@ -54,7 +54,7 @@ export const SyncUserSchema = z.looseObject({
|
|
|
54
54
|
daysOff: z.array(z.number().int()),
|
|
55
55
|
featureIdentifier: z.string(),
|
|
56
56
|
features: FeaturesSchema,
|
|
57
|
-
freeTrailExpires: z.
|
|
57
|
+
freeTrailExpires: z.coerce.date().optional(),
|
|
58
58
|
hasMagicNumber: z.boolean(),
|
|
59
59
|
hasPassword: z.boolean(),
|
|
60
60
|
hasStartedATrial: z.boolean().optional(),
|
|
@@ -63,7 +63,7 @@ export const SyncUserSchema = z.looseObject({
|
|
|
63
63
|
isCelebrationsEnabled: z.boolean(),
|
|
64
64
|
isPremium: z.boolean(),
|
|
65
65
|
joinableWorkspace: JoinableWorkspaceSchema.nullable(),
|
|
66
|
-
joinedAt: z.
|
|
66
|
+
joinedAt: z.coerce.date(),
|
|
67
67
|
gettingStartedGuideProjects: z.array(GettingStartedGuideProjectSchema).nullable(),
|
|
68
68
|
karma: z.number(),
|
|
69
69
|
karmaTrend: z.string(),
|
|
@@ -81,13 +81,13 @@ export const SyncUserSchema = z.looseObject({
|
|
|
81
81
|
onboardingTeamMode: z.boolean().nullable().optional(),
|
|
82
82
|
onboardingUseCases: z.array(z.string()).nullable().optional(),
|
|
83
83
|
premiumStatus: z.enum(PREMIUM_STATUSES),
|
|
84
|
-
premiumUntil: z.
|
|
84
|
+
premiumUntil: z.coerce.date().nullable(),
|
|
85
85
|
rambleSessionsUsage: z
|
|
86
86
|
.object({
|
|
87
87
|
currentCount: z.number().int(),
|
|
88
88
|
limit: z.number().int(),
|
|
89
89
|
remaining: z.number().int(),
|
|
90
|
-
resetDate: z.
|
|
90
|
+
resetDate: z.coerce.date(),
|
|
91
91
|
})
|
|
92
92
|
.nullable()
|
|
93
93
|
.optional(),
|
|
@@ -18,6 +18,6 @@ export const WorkspaceGoalSchema = z.looseObject({
|
|
|
18
18
|
projectIds: z.array(z.string()),
|
|
19
19
|
progress: WorkspaceGoalProgressSchema.nullable(),
|
|
20
20
|
creatorUid: z.string(),
|
|
21
|
-
createdAt: z.
|
|
22
|
-
updatedAt: z.
|
|
21
|
+
createdAt: z.coerce.date(),
|
|
22
|
+
updatedAt: z.coerce.date(),
|
|
23
23
|
});
|
|
@@ -29,8 +29,8 @@ export const SyncWorkspaceSchema = z
|
|
|
29
29
|
logoSmall: z.string().optional(),
|
|
30
30
|
logoS640: z.string().optional(),
|
|
31
31
|
creatorId: StringOrNumberSchema,
|
|
32
|
-
createdAt: z.
|
|
33
|
-
dateCreated: z.
|
|
32
|
+
createdAt: z.coerce.date().optional(),
|
|
33
|
+
dateCreated: z.coerce.date().optional(),
|
|
34
34
|
isDeleted: z.boolean(),
|
|
35
35
|
isCollapsed: z.boolean(),
|
|
36
36
|
role: WorkspaceRoleSchema.optional(),
|
|
@@ -58,7 +58,7 @@ export const SyncWorkspaceSchema = z
|
|
|
58
58
|
defaultCollaborators: z
|
|
59
59
|
.object({
|
|
60
60
|
predefinedGroupIds: z.array(z.string()),
|
|
61
|
-
userIds: z.array(
|
|
61
|
+
userIds: z.array(StringOrNumberSchema),
|
|
62
62
|
})
|
|
63
63
|
.optional(),
|
|
64
64
|
properties: WorkspacePropertiesSchema.optional(),
|
|
@@ -37,9 +37,9 @@ export const TaskSchema = z
|
|
|
37
37
|
duration: DurationSchema.nullable(),
|
|
38
38
|
checked: z.boolean(),
|
|
39
39
|
isDeleted: z.boolean(),
|
|
40
|
-
addedAt: z.
|
|
41
|
-
completedAt: z.
|
|
42
|
-
updatedAt: z.
|
|
40
|
+
addedAt: z.coerce.date().nullable(),
|
|
41
|
+
completedAt: z.coerce.date().nullable(),
|
|
42
|
+
updatedAt: z.coerce.date().nullable(),
|
|
43
43
|
due: DueDateSchema.nullable(),
|
|
44
44
|
priority: z.number().int(),
|
|
45
45
|
childOrder: z.number().int(),
|
|
@@ -71,7 +71,7 @@ export const WorkspacePlanDetailsSchema = z.object({
|
|
|
71
71
|
currentActiveProjects: z.number(),
|
|
72
72
|
maximumActiveProjects: z.number(),
|
|
73
73
|
priceList: z.array(FormattedPriceListingSchema),
|
|
74
|
-
workspaceId:
|
|
74
|
+
workspaceId: StringOrNumberSchema,
|
|
75
75
|
isTrialing: z.boolean(),
|
|
76
76
|
trialEndsAt: z.string().nullable(),
|
|
77
77
|
cancelAtPeriodEnd: z.boolean(),
|
|
@@ -122,8 +122,8 @@ export const WorkspaceSchema = z
|
|
|
122
122
|
logoMedium: z.string().nullish(),
|
|
123
123
|
logoSmall: z.string().nullish(),
|
|
124
124
|
logoS640: z.string().nullish(),
|
|
125
|
-
createdAt: z.
|
|
126
|
-
dateCreated: z.
|
|
125
|
+
createdAt: z.coerce.date().optional(),
|
|
126
|
+
dateCreated: z.coerce.date().optional(),
|
|
127
127
|
creatorId: StringOrNumberSchema,
|
|
128
128
|
properties: WorkspacePropertiesSchema,
|
|
129
129
|
})
|
|
@@ -83,5 +83,5 @@ export declare const ENDPOINT_WORKSPACE_MEMBERS = "workspaces/members";
|
|
|
83
83
|
export declare function getWorkspaceUserTasksEndpoint(workspaceId: string, userId: string): string;
|
|
84
84
|
export declare function getWorkspaceInviteUsersEndpoint(workspaceId: string): string;
|
|
85
85
|
export declare function getWorkspaceUserEndpoint(workspaceId: string, userId: string): string;
|
|
86
|
-
export declare function getWorkspaceActiveProjectsEndpoint(workspaceId:
|
|
87
|
-
export declare function getWorkspaceArchivedProjectsEndpoint(workspaceId:
|
|
86
|
+
export declare function getWorkspaceActiveProjectsEndpoint(workspaceId: string): string;
|
|
87
|
+
export declare function getWorkspaceArchivedProjectsEndpoint(workspaceId: string): string;
|